From 8a0c69ba299ec465d853d3f2fc7b411893cdf9e0 Mon Sep 17 00:00:00 2001 From: Zhisheng Huang Date: Wed, 12 Jun 2019 18:30:50 -0700 Subject: [PATCH] Cleanup the skiplayout in reloadData fallback Summary: The test was actually deallocated last year, and this test is never cleaned up. Now let's clean it up. Reviewed By: chritto Differential Revision: D15777898 fbshipit-source-id: c3a704ee1bfdd085c4ceb89af424a10ed07a65b6 --- Source/Common/IGListExperiments.h | 4 +--- Source/IGListAdapterUpdater.m | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Source/Common/IGListExperiments.h b/Source/Common/IGListExperiments.h index ca7acd90..53eff84d 100644 --- a/Source/Common/IGListExperiments.h +++ b/Source/Common/IGListExperiments.h @@ -24,10 +24,8 @@ typedef NS_OPTIONS (NSInteger, IGListExperiment) { IGListExperimentDeferredToObjectCreation = 1 << 6, /// Test getting collection view at update time. IGListExperimentGetCollectionViewAtUpdate = 1 << 7, - /// Test skipping layout when UICollectionView isn't visible - IGListExperimentSkipLayout = 1 << 8, /// Test invalidating layout when cell reloads/updates in IGListBindingSectionController. - IGListExperimentInvalidateLayoutForUpdates = 1 << 9, + IGListExperimentInvalidateLayoutForUpdates = 1 << 8, }; /** diff --git a/Source/IGListAdapterUpdater.m b/Source/IGListAdapterUpdater.m index 71eb84e0..130f9a81 100644 --- a/Source/IGListAdapterUpdater.m +++ b/Source/IGListAdapterUpdater.m @@ -174,10 +174,8 @@ [self _cleanStateAfterUpdates]; [self _performBatchUpdatesItemBlockApplied]; [collectionView reloadData]; - if (!IGListExperimentEnabled(self.experiments, IGListExperimentSkipLayout) - || collectionView.window != nil) { - [collectionView layoutIfNeeded]; - } + [collectionView layoutIfNeeded]; + executeCompletionBlocks(YES); };