Created
February 20, 2012 05:00
-
-
Save mrsidique/1867937 to your computer and use it in GitHub Desktop.
Infinite Scroll
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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