fixed IGListAdapterUpdater completion block animation transaction

Summary:
* Issue: UIView animation blocks created within IGListAdapterUpdater's completion block work sporadically. Example: Direct message animation:

https://pxl.cl/8sTk

* Cause: completion block called within CATransaction begin/commit
* Fix: commit CATransaction before calling completion block

Reviewed By: rnystrom

Differential Revision: D5592948

fbshipit-source-id: e7b20877b688a6a221a87b152ead830ccb34f12a
This commit is contained in:
Maxime Ollivier 2017-08-10 06:16:48 -07:00 committed by Facebook Github Bot
parent 9e312275c3
commit 6f946b2981
2 changed files with 2 additions and 1 deletions

View file

@ -9,6 +9,7 @@ The changelog for `IGListKit`. Also see the [releases](https://github.com/instag
- Prevent a crash when update queued immediately after item batch update. [Ryan Nystrom](https://github.com/rnystrom) (tbd)
- Return correct `-[IGListAdapter visibleSectionControllers]` when section has no items, but has supplementary views. [Mani Ghasemlou](https://github.com/manicakes) [(#643)](https://github.com/Instagram/IGListKit/issues/643)
- Call `[CATransaction commit]` before calling completion block in IGListAdapterUpdater to prevent animation issues. [Maxime Ollivier](https://github.com/maxoll) (tbd)
### Enhancements

View file

@ -235,8 +235,8 @@ static NSArray *objectsWithDuplicateIdentifiersRemoved(NSArray<id<IGListDiffable
[collectionView performBatchUpdates:^{
batchUpdatesBlock(result);
} completion:^(BOOL finished) {
batchUpdatesCompletionBlock(finished);
[CATransaction commit];
batchUpdatesCompletionBlock(finished);
}];
}
} @catch (NSException *exception) {