Skip to content

Instantly share code, notes, and snippets.

@mrsidique
Created February 20, 2012 05:00
Show Gist options
  • Save mrsidique/1867937 to your computer and use it in GitHub Desktop.
Save mrsidique/1867937 to your computer and use it in GitHub Desktop.
Infinite Scroll
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
[_refreshHeaderView egoRefreshScrollViewDidScroll:scrollView];
fetchingMoreMessages = NO;
if(self.tableView.contentOffset.y<0){
//it means table view is pulled down like refresh
return;
}
else if(self.tableView.contentOffset.y >= (self.tableView.contentSize.height - self.tableView.bounds.size.height)) {
fetchingMoreMessages = YES;
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(fetchOlderMessages) object:nil];
[self performSelector:@selector(fetchOlderMessages) withObject:nil afterDelay:0];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment