Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Reload tableview when scrolling
pageNumber = 1;
-(void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{
NSInteger currentOffset = scrollView.contentOffset.y;
NSInteger maximumOffset = scrollView.contentSize.height - scrollView.frame.size.height;
if (maximumOffset - currentOffset <= - 40 && hasNextPage)
{
[self fetchData];
pageNumber += 1;
}
}
-(void)fetchData
{
// request and load data
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment