Skip to content

Commit

Permalink
Merge pull request #37 from qpwang/master
Browse files Browse the repository at this point in the history
Prevent infiniteScroll conflict
  • Loading branch information
m1entus committed Mar 31, 2015
2 parents 4aaf39a + a20351b commit 80e4151
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion INSPullToRefresh/INSInfiniteScrollBackgroundView.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ - (void)scrollViewDidScroll:(CGPoint)contentOffset {

// The lower bound when infinite scroll should kick in
CGFloat actionOffset = contentHeight - self.scrollView.bounds.size.height + self.scrollView.contentInset.bottom - self.additionalBottomOffsetForInfinityScrollTrigger;

// Prevent conflict with pull to refresh when tableView is too short
actionOffset = fmaxf(actionOffset, self.additionalBottomOffsetForInfinityScrollTrigger);

// Disable infinite scroll when scroll view is empty
// Default UITableView reports height = 1 on empty tables
BOOL hasActualContent = (self.scrollView.contentSize.height > 1);
Expand Down

0 comments on commit 80e4151

Please sign in to comment.