Skip to content

Commit fe69a19

Browse files
Prevent INSInfiniteScrollBackgroundView from changing content inset multiple times after consecutive endInfiniteScrollingWithStoppingContentOffset calls
1 parent 89e2943 commit fe69a19

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

INSPullToRefresh/INSInfiniteScrollBackgroundView.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ typedef void(^INSInfinityScrollActionHandler)(UIScrollView *scrollView);
3232
typedef NS_ENUM(NSUInteger, INSInfiniteScrollBackgroundViewState) {
3333
INSInfiniteScrollBackgroundViewStateNone = 0,
3434
INSInfiniteScrollBackgroundViewStateLoading,
35+
INSInfiniteScrollBackgroundViewStateStopping,
3536
};
3637

3738
@class INSInfiniteScrollBackgroundView;

INSPullToRefresh/INSInfiniteScrollBackgroundView.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ - (void)stopInfiniteScrollWithStoppingContentOffset:(BOOL)stopContentOffset {
274274

275275
CGPoint offset = CGPointMake(self.scrollView.contentOffset.x, self.scrollView.contentOffset.y);
276276

277+
[self changeState:INSInfiniteScrollBackgroundViewStateStopping];
278+
277279
__weak typeof(self)weakSelf = self;
278280
[self setScrollViewContentInset:contentInset animated:!stopContentOffset completion:^(BOOL finished) {
279281

0 commit comments

Comments
 (0)