Skip to content

Commit

Permalink
Fix an issue where setContentOffset:animated: with animated=NO can ac…
Browse files Browse the repository at this point in the history
…tually call scrollViewDidEndScrollingAnimation:, which results in trying to set the page to -1. This was causing some weird behavior
  • Loading branch information
Joe Turner committed Sep 11, 2015
1 parent d661bc5 commit c10b252
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pagingscrollview/src/NIPagingScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,12 @@ - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
}

- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView {
[self didAnimateToPage:_animatingToPageIndex];
if (_animatingToPageIndex >= 0) {
[self didAnimateToPage:_animatingToPageIndex];

if ([self.delegate respondsToSelector:_cmd]) {
[self.delegate scrollViewDidEndScrollingAnimation:scrollView];
if ([self.delegate respondsToSelector:_cmd]) {
[self.delegate scrollViewDidEndScrollingAnimation:scrollView];
}
}
}

Expand Down

0 comments on commit c10b252

Please sign in to comment.