Skip to content

Commit

Permalink
Fix load more bug for iOS6.
Browse files Browse the repository at this point in the history
  • Loading branch information
xhzengAIB committed Jul 10, 2014
1 parent 04a3d17 commit 77e8a5a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 0 additions & 2 deletions RefreshControl/XHRefreshControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,6 @@ - (void)setScrollViewContentInsetForLoading {
}

- (void)setScrollViewContentInsetForLoadMore {
if (self.pullDownRefreshing)
return;
UIEdgeInsets currentInsets = self.scrollView.contentInset;
currentInsets.bottom = kXHLoadMoreViewHeight;
[self setScrollViewContentInset:currentInsets];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ - (void)loadDataSource {
if (self.requestCurrentPage == arc4random() % 10) {
[self handleLoadMoreError];
} else {

[self.dataSource addObjectsFromArray:dataSource];
[self.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];
[self endLoadMoreRefreshing];
}
} else {

self.dataSource = dataSource;
[self.tableView reloadData];
[self endPullDownRefreshing];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ - (void)loadDataSource {
if (self.requestCurrentPage == arc4random() % 10) {
[self handleLoadMoreError];
} else {
[self endLoadMoreRefreshing];
[self.dataSource addObjectsFromArray:dataSource];
[self.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];
[self endLoadMoreRefreshing];

}
} else {
[self endPullDownRefreshing];
self.dataSource = dataSource;
[self.tableView reloadData];
[self endPullDownRefreshing];

}
});
});
Expand Down

0 comments on commit 77e8a5a

Please sign in to comment.