Skip to content

Commit

Permalink
observer leak bug fix
Browse files Browse the repository at this point in the history
fix a observer leak if the developer set the show status to YES before
add the handler.
  • Loading branch information
bestwnh committed Sep 28, 2014
1 parent a5f9dfe commit afe760c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SVPullToRefresh/UIScrollView+SVInfiniteScrolling.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ - (SVInfiniteScrollingView *)infiniteScrollingView {
}

- (void)setShowsInfiniteScrolling:(BOOL)showsInfiniteScrolling {

if (!self.infiniteScrollingView)
return;

self.infiniteScrollingView.hidden = !showsInfiniteScrolling;

if(!showsInfiniteScrolling) {
Expand Down
4 changes: 4 additions & 0 deletions SVPullToRefresh/UIScrollView+SVPullToRefresh.m
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ - (SVPullToRefreshView *)pullToRefreshView {
}

- (void)setShowsPullToRefresh:(BOOL)showsPullToRefresh {

if (!self.pullToRefreshView)
return;

self.pullToRefreshView.hidden = !showsPullToRefresh;

if(!showsPullToRefresh) {
Expand Down

1 comment on commit afe760c

@dennisreimann
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks man, this helped me a lot!

Please sign in to comment.