Created
December 8, 2016 02:01
-
-
Save jaisonv/62e5559b5d5c97f2ecc8cb0efeb1ad76 to your computer and use it in GitHub Desktop.
Reload tableview when scrolling
This file contains 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
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