IGListKit/Source/Common
Zhisheng Huang f699ea0e17 Add option to update cells instead of delete+insert for section reload
Summary:
We have seen unnecessary flashiness updates for any section reload updates.

Basically we have 1 section for 1 cell, which is recommended by the IGListKit document in https://instagram.github.io/IGListKit/best-practices-and-faq.html, specifically:

> "We highly recommend using single-item sections when possible."

However, the issue is that whenever we update the underlying data model, we would trigger a delete+insert for the section reload.

In order to mitigate that, we can fix this delete+insert changes or we use the `IGListBindingSectionController`, however, the latter one requires more refactoring plus view model wrapper to have `isEqualToDifferable:` to return YES, which seems less than ideal.

I am proposing that we add an option to the `IGListAdapterUpdater`, as `preferItemReloadsForSectionReloads` so that when it's set to YES, we would trigger the proper `-[UICollectionView reloadItemsAtIndexPaths:]` which handles the cell update properly.

This option also handles the case where the number of items in the section is changed before and after the updates, in that case, it will fallback to do the "delete+insert" section operation.

Reviewed By: rnystrom

Differential Revision: D9519519

fbshipit-source-id: 22ecca07679ebdd212cf771c61e40887cb6a9ba8
2018-08-28 23:32:43 -07:00
..
Internal log instead of assert for duplicate object identifiers 2018-07-10 07:03:50 -07:00
IGListAssert.h Relicense to MIT 2018-05-01 14:50:56 -07:00
IGListBatchUpdateData.h Add option to update cells instead of delete+insert for section reload 2018-08-28 23:32:43 -07:00
IGListBatchUpdateData.mm Add option to update cells instead of delete+insert for section reload 2018-08-28 23:32:43 -07:00
IGListCompatibility.h Relicense to MIT 2018-05-01 14:50:56 -07:00
IGListDiff.h Relicense to MIT 2018-05-01 14:50:56 -07:00
IGListDiff.mm Fixed assertion #trivial (#1203) 2018-07-25 12:17:24 -07:00
IGListDiffable.h Relicense to MIT 2018-05-01 14:50:56 -07:00
IGListDiffKit.h Relicense to MIT 2018-05-01 14:50:56 -07:00
IGListExperiments.h Remove unused experimental feature 2018-07-26 09:17:40 -07:00
IGListIndexPathResult.h Relicense to MIT 2018-05-01 14:50:56 -07:00
IGListIndexPathResult.m Relicense to MIT 2018-05-01 14:50:56 -07:00
IGListIndexSetResult.h Relicense to MIT 2018-05-01 14:50:56 -07:00
IGListIndexSetResult.m Relicense to MIT 2018-05-01 14:50:56 -07:00
IGListMacros.h Relicense to MIT 2018-05-01 14:50:56 -07:00
IGListMoveIndex.h Relicense to MIT 2018-05-01 14:50:56 -07:00
IGListMoveIndex.m Relicense to MIT 2018-05-01 14:50:56 -07:00
IGListMoveIndexPath.h Relicense to MIT 2018-05-01 14:50:56 -07:00
IGListMoveIndexPath.m Relicense to MIT 2018-05-01 14:50:56 -07:00
NSNumber+IGListDiffable.h Relicense to MIT 2018-05-01 14:50:56 -07:00
NSNumber+IGListDiffable.m Relicense to MIT 2018-05-01 14:50:56 -07:00
NSString+IGListDiffable.h Relicense to MIT 2018-05-01 14:50:56 -07:00
NSString+IGListDiffable.m Relicense to MIT 2018-05-01 14:50:56 -07:00