From 403b7e7ba925703c200ec6dd6db85ed32dc75b25 Mon Sep 17 00:00:00 2001 From: Jordan Smith Date: Wed, 26 Feb 2020 10:48:59 -0800 Subject: [PATCH] Roll out deffered [CATransaction commit] fix Summary: **Context** Recently an IGListKit experiment was introduced, `IGListExperimentPerformUpdatesWithoutDeferringCATransactionCommit`. When enabled, we opt to no longer defer a call to `[CATransaction commit]`, because it could feasibly end a different transaction than intended. In practice, this was leading to issues with `UIViewPropertyAnimator`, where deffered commits were ending in-progress animators. **This Change** The results we have seen from enabling this fix show no changes to performance and stability, so this seems safe to roll out. This change removes the experiment, and enables the new, non-deffered behavior. Reviewed By: lorixx Differential Revision: D20120169 fbshipit-source-id: 0473652020a250d67b02b860fb74c73e43615aef --- Source/IGListDiffKit/IGListExperiments.h | 4 +--- Source/IGListKit/IGListAdapterUpdater.m | 17 +++-------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/Source/IGListDiffKit/IGListExperiments.h b/Source/IGListDiffKit/IGListExperiments.h index 1ba01963..63083d3d 100644 --- a/Source/IGListDiffKit/IGListExperiments.h +++ b/Source/IGListDiffKit/IGListExperiments.h @@ -31,9 +31,7 @@ typedef NS_OPTIONS (NSInteger, IGListExperiment) { /// Test invalidating layout when cell reloads/updates in IGListBindingSectionController. IGListExperimentInvalidateLayoutForUpdates = 1 << 8, /// Test using the collection view when asking for layout instead of accessing the data source. Only apply to IGListCollectionViewLayout. - IGListExperimentUseCollectionViewInsteadOfDataSourceInLayout = 1 << 9, - /// Test committing CATransactions inline instead of batching potentially unrelated animations - IGListExperimentPerformUpdatesWithoutDeferringCATransactionCommit = 1 << 10 + IGListExperimentUseCollectionViewInsteadOfDataSourceInLayout = 1 << 9 }; /** diff --git a/Source/IGListKit/IGListAdapterUpdater.m b/Source/IGListKit/IGListAdapterUpdater.m index 33f98d47..d533bf1d 100644 --- a/Source/IGListKit/IGListAdapterUpdater.m +++ b/Source/IGListKit/IGListAdapterUpdater.m @@ -260,22 +260,11 @@ willPerformBatchUpdatesWithCollectionView:collectionView batchUpdatesBlock(result); } completion:batchUpdatesCompletionBlock]; } else { - if (IGListExperimentEnabled(experiments, IGListExperimentPerformUpdatesWithoutDeferringCATransactionCommit)) { - [UIView performWithoutAnimation:^{ - [collectionView performBatchUpdates:^{ - batchUpdatesBlock(result); - } completion:batchUpdatesCompletionBlock]; - }]; - } else { - [CATransaction begin]; - [CATransaction setDisableActions:YES]; + [UIView performWithoutAnimation:^{ [collectionView performBatchUpdates:^{ batchUpdatesBlock(result); - } completion:^(BOOL finished) { - [CATransaction commit]; - batchUpdatesCompletionBlock(finished); - }]; - } + } completion:batchUpdatesCompletionBlock]; + }]; } } @catch (NSException *exception) { [delegate listAdapterUpdater:self