Reputation: 7921
i want to implement the feature PullDownToRefresh like Twitter app. I'm using EGORefreshTableHeaderView and PullToRefreshTableView classes, but i've an error in this point in PullToRefreshTableView.m class :
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
if (scrollView.isDragging) {
/*here is the error/* if (refreshHeaderView.state == EGOOPullRefreshPulling && scrollView.contentOffset.y > -65.0f && scrollView.contentOffset.y < 0.0f && !_reloading) {
[refreshHeaderView setState:EGOOPullRefreshNormal];
} else if (refreshHeaderView.state == EGOOPullRefreshNormal && scrollView.contentOffset.y < -65.0f && !_reloading) {
[refreshHeaderView setState:EGOOPullRefreshPulling];
}
}
}
Upvotes: 0
Views: 378
Reputation: 651
You dont have to write a code inside table view controller's method '- (void)scrollViewDidScroll:(UIScrollView *)scrollView'. Instead, just call the super class's method '[_refreshHeaderView egoRefreshScrollViewDidScroll:scrollView];' So, your code must look like this:- - (void)scrollViewDidScroll:(UIScrollView *)scrollView{ [_refreshHeaderView egoRefreshScrollViewDidScroll:scrollView]; } download the demo here and learn from it. - Regards, Rickie
Upvotes: 0
Reputation: 5611
Try out this cool plugin from Leah. It's called PullToRefresh and is hosted on GitHub.
Upvotes: 1