Skip to content

Commit

Permalink
ship IGListExperimentSkipLayoutBeforeUpdate
Browse files Browse the repository at this point in the history
Summary: Experiment looks good, so lets ship.

Reviewed By: patters

Differential Revision: D23145775

fbshipit-source-id: 16da69f220a2247490bb99b4965bcba33f498ced
  • Loading branch information
maxolls authored and facebook-github-bot committed Sep 8, 2020
1 parent 254c041 commit aca18c7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ The changelog for `IGListKit`. Also see the [releases](https://github.com/instag

- Remove `[collectionView layoutIfNeeded]` before scrolling in `[IGListAdapter scrollToObject...]` to avoid creating off-screen cells. [Maxime Ollivier](https://github.com/maxolls) (tbd)

- Remove `[collectionView layoutIfNeeded]` before updating in `[IGListAdapterUpdater performBatchUpdates...]` to fix occasional glitches. [Maxime Ollivier](https://github.com/maxolls) (tbd)

- Fixed `IGListAdapterUpdaterDelegate` by 1) calling `willReloadDataWithCollectionView` on fallback reloads and 2) making sure `willPerformBatchUpdatesWithCollectionView` is only called when performing a batch update. [Maxime Ollivier](https://github.com/maxolls) (tbd)

- Fixed missing update when calling `performUpdatesAnimated` multiple times quickly and using the `reloadDataFallback()`. [Maxime Ollivier](https://github.com/maxolls) (tbd)
Expand Down
4 changes: 1 addition & 3 deletions Source/IGListDiffKit/IGListExperiments.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ typedef NS_OPTIONS (NSInteger, IGListExperiment) {
IGListExperimentBackgroundDiffing = 1 << 2,
/// Test invalidating layout when cell reloads/updates in IGListBindingSectionController.
IGListExperimentInvalidateLayoutForUpdates = 1 << 3,
/// Test removing the layout before performing an update
IGListExperimentSkipLayoutBeforeUpdate = 1 << 4,
/// Test array and set optimization on update
IGListExperimentArrayAndSetOptimization = 1 << 5,
IGListExperimentArrayAndSetOptimization = 1 << 4,
};

/**
Expand Down
4 changes: 0 additions & 4 deletions Source/IGListKit/IGListAdapterUpdater.m
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,6 @@ - (void)performBatchUpdatesWithCollectionViewBlock:(IGListCollectionViewBlock)co

// block that executes the batch update and exception handling
void (^tryToPerformUpdate)(IGListIndexSetResult *) = ^(IGListIndexSetResult *result){
if (!IGListExperimentEnabled(experiments, IGListExperimentSkipLayoutBeforeUpdate)) {
[collectionView layoutIfNeeded];
}

@try {
if (collectionView.dataSource == nil) {
// If the data source is nil, we should not call any collection view update.
Expand Down
2 changes: 0 additions & 2 deletions Tests/IGListAdapterUpdaterTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,6 @@ - (void)test_whenPerformIndexPathUpdates_reloadingTheSameIndexPathMultipleTimes_
}

- (void)test_whenPerformingUpdatesMultipleTimesInARow_thenUpdateWorks {
self.updater.experiments |= IGListExperimentSkipLayoutBeforeUpdate;

NSArray *objects1 = @[
[IGSectionObject sectionWithObjects:@[@0]]
];
Expand Down

0 comments on commit aca18c7

Please sign in to comment.