Created
December 11, 2015 06:51
-
-
Save victorchee/2d2f3666993ddc9970e4 to your computer and use it in GitHub Desktop.
Scroll with page control.
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
#pragma mark - UIScrollViewDelegate | |
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView | |
{ | |
NSInteger pageIndex = lroundf(scrollView.contentOffset.x / CGRectGetWidth(scrollView.frame)); | |
pageControl.currentPage = pageIndex; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment