Skip to content

Commit

Permalink
Implement samvermette#297.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmurray committed Oct 20, 2017
1 parent 7974473 commit 53f968f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions SVPullToRefresh/UIScrollView+SVInfiniteScrolling.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ typedef NSUInteger SVInfiniteScrollingState;

@interface SVInfiniteScrollingView : UIView

@property (nonatomic, readwrite) CGFloat originalBottomInset;
@property (nonatomic, readwrite) UIActivityIndicatorViewStyle activityIndicatorViewStyle;
@property (nonatomic, readonly) SVInfiniteScrollingState state;
@property (nonatomic, readonly) SVInfiniteScrollingDirection direction;
Expand Down
14 changes: 13 additions & 1 deletion SVPullToRefresh/UIScrollView+SVInfiniteScrolling.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ @interface SVInfiniteScrollingView ()
@property (nonatomic, readwrite) SVInfiniteScrollingDirection direction;
@property (nonatomic, strong) NSMutableArray *viewForState;
@property (nonatomic, weak) UIScrollView *scrollView;
@property (nonatomic, readwrite) CGFloat originalBottomInset;
@property (nonatomic, readwrite) CGFloat originalTopInset;
@property (nonatomic, assign) BOOL wasTriggeredByUser;
@property (nonatomic, assign) BOOL isObserving;
Expand Down Expand Up @@ -210,6 +209,19 @@ - (void)setScrollViewContentInsetForInfiniteScrolling {
[self setScrollViewContentInset:currentInsets];
}

- (void)setOriginalBottomInset:(CGFloat)originalBottomInset {
if (_originalBottomInset != originalBottomInset) {
_originalBottomInset = originalBottomInset;

if (self.isObserving) {
[self setScrollViewContentInsetForInfiniteScrolling];
}
else {
[self resetScrollViewContentInset];
}
}
}

- (void)setScrollViewContentInset:(UIEdgeInsets)contentInset {
[UIView animateWithDuration:0.3
delay:0
Expand Down

0 comments on commit 53f968f

Please sign in to comment.