Skip to content

Commit

Permalink
Dispatch batch update to main #trivial (#626)
Browse files Browse the repository at this point in the history
* Dispatch batch update to main

* TableView too
  • Loading branch information
garrettmoon committed Oct 20, 2017
1 parent 919ec8d commit d31af73
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Source/ASCollectionView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1587,7 +1587,9 @@ - (void)setLeadingScreensForBatching:(CGFloat)leadingScreensForBatching
{
if (_leadingScreensForBatching != leadingScreensForBatching) {
_leadingScreensForBatching = leadingScreensForBatching;
[self _checkForBatchFetching];
ASPerformBlockOnMainThread(^{
[self _checkForBatchFetching];
});
}
}

Expand Down
7 changes: 6 additions & 1 deletion Source/ASTableView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,12 @@ - (CGFloat)leadingScreensForBatching

- (void)setLeadingScreensForBatching:(CGFloat)leadingScreensForBatching
{
_leadingScreensForBatching = leadingScreensForBatching;
if (_leadingScreensForBatching != leadingScreensForBatching) {
_leadingScreensForBatching = leadingScreensForBatching;
ASPerformBlockOnMainThread(^{
[self _checkForBatchFetching];
});
}
}

- (BOOL)automaticallyAdjustsContentOffset
Expand Down

0 comments on commit d31af73

Please sign in to comment.