Skip to content

Commit

Permalink
fix load previous messages UI flashing bug
Browse files Browse the repository at this point in the history
Summary:
More reliably prevent animations in `-[IGListAdapter performUpdatesAnimated: completion:]`.

Fixes potential UI flashing and glitches in `performUpdatesAnimated:` when suppressing animations by passing `NO`.

Reviewed By: rnystrom

Differential Revision: D4453115

fbshipit-source-id: a9418b4bc0e11a14d6a5037178bade424ef9617d
  • Loading branch information
jessesquires authored and facebook-github-bot committed Jan 24, 2017
1 parent 528bd33 commit 019c990
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ This release closes the [2.2.0 milestone](https://github.com/Instagram/IGListKit
### Fixes

- Fix bug where emptyView's hidden status is not updated after the number of items is changed with `insertInSectionController:atIndexes:` or related methods. [Peter Edmonston](https://github.com/edmonston) [(#395)](https://github.com/Instagram/IGListKit/pull/395)

- Fix bug where `IGListStackedSectionController`'s children need to know `numberOrItems` before didUpdate is called. [(#348)](https://github.com/Instagram/IGListKit/pull/390)

- Fix bug where `-[UICollectionViewCell ig_setStackedSectionControllerIndex:]` should use `OBJC_ASSOCIATION_COPY_NONATOMIC` for NSNumber. [PhilCai](https://github.com/PhilCai1993) [(#424)](https://github.com/Instagram/IGListKit/pull/426)

- Fix potential bug with suppressing animations (by passing `NO`) during `-[IGListAdapter performUpdatesAnimated: completion:]` where user would see UI glitches/flashing. [Jesse Squires](https://github.com/jessesquires) [(tbd)]()

2.1.0
-----

Expand Down
7 changes: 5 additions & 2 deletions Source/IGListAdapterUpdater.m
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,11 @@ - (void)performBatchUpdatesWithCollectionView:(UICollectionView *)collectionView
if (animated) {
[collectionView performBatchUpdates:updateBlock completion:completionBlock];
} else {
[UIView performWithoutAnimation:^{
[collectionView performBatchUpdates:updateBlock completion:completionBlock];
[CATransaction begin];
[CATransaction setDisableActions:YES];
[collectionView performBatchUpdates:updateBlock completion:^(BOOL finished) {
completionBlock(finished);
[CATransaction commit];
}];
}
} @catch (NSException *exception) {
Expand Down

0 comments on commit 019c990

Please sign in to comment.