Skip to content

Commit

Permalink
Merge pull request samvermette#100 from luosky/master
Browse files Browse the repository at this point in the history
Prevent infiniteScrolling being triggered multiple times.
  • Loading branch information
samvermette committed Jan 16, 2013
2 parents 52431a4 + e2d210a commit fcb4222
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SVPullToRefresh/UIScrollView+SVInfiniteScrolling.m
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ - (void)scrollViewDidScroll:(CGPoint)contentOffset {
CGFloat scrollViewContentHeight = self.scrollView.contentSize.height;
CGFloat scrollOffsetThreshold = scrollViewContentHeight-self.scrollView.bounds.size.height;

if(!self.scrollView.isDragging && self.state == SVInfiniteScrollingStateTriggered && !self.scrollView.isDragging)
if(!self.scrollView.isDragging && self.state == SVInfiniteScrollingStateTriggered)
self.state = SVInfiniteScrollingStateLoading;
else if(contentOffset.y > scrollOffsetThreshold && self.state == SVInfiniteScrollingStateStopped && self.scrollView.isDecelerating)
else if(contentOffset.y > scrollOffsetThreshold && self.state == SVInfiniteScrollingStateStopped && self.scrollView.isDragging)
self.state = SVInfiniteScrollingStateTriggered;
else if(contentOffset.y < scrollOffsetThreshold && self.state != SVInfiniteScrollingStateStopped)
self.state = SVInfiniteScrollingStateStopped;
Expand Down

0 comments on commit fcb4222

Please sign in to comment.