Skip to content

Instantly share code, notes, and snippets.

@jaisonv
Created December 8, 2016 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaisonv/62e5559b5d5c97f2ecc8cb0efeb1ad76 to your computer and use it in GitHub Desktop.
Save jaisonv/62e5559b5d5c97f2ecc8cb0efeb1ad76 to your computer and use it in GitHub Desktop.
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