IGListKit v5.0.0 Release Notes
-
๐ฅ Breaking Changes
โ Removed unneeded diffing functions
IGListDiffExperiment(...)
andIGListDiffPathsExperiment(...)
. Maxime Ollivier (tbd)โ
ListSectionController.collectionContext
andListGenericSectionController.object
are now implicitly-unwrapped optionals in Swift. Nate Stedman (tbd)โก๏ธ The argument of
IGListGenericSectionController
's-didUpdateToObject:
is now generic, notid
. Nate Stedman (tbd)โก๏ธ Updated
IGListUpdatingDelegate
, including a new method to safely perform[IGListAdapter setDataSource:]
and changes to-performUpdateWithCollectionViewBlock
that allows section-controllers to be created before the diffing (and therefore use a more accuratetoObjects
array) Maxime Ollivier (tbd)
// OLD - (void)performUpdateWithCollectionViewBlock:(IGListCollectionViewBlock)collectionViewBlock fromObjects:(nullable NSArray<id <IGListDiffable>> *)fromObjects toObjectsBlock:(nullable IGListToObjectBlock)toObjectsBlock animated:(BOOL)animated objectTransitionBlock:(IGListObjectTransitionBlock)objectTransitionBlock completion:(nullable IGListUpdatingCompletion)completion; // NEW - (void)performUpdateWithCollectionViewBlock:(IGListCollectionViewBlock)collectionViewBlock animated:(BOOL)animated sectionDataBlock:(IGListTransitionDataBlock)sectionDataBlock applySectionDataBlock:(IGListTransitionDataApplyBlock)applySectionDataBlock completion:(nullable IGListUpdatingCompletion)completion; // NEW - (void)performDataSourceChange:(IGListDataSourceChangeBlock)block;
โ Removed
allowsBackgroundReloading
fromIGListAdapterUpdater
because it's causing performance issues and other bugs. Maxime Ollivier (tbd)โก๏ธ Introducing
allowsBackgroundDiffing
onIGListAdapterUpdater
! This property lets the updater perform the diffing on a background thread. Originally introduced by Ryan Nystrom a while back. Maxime Ollivier (tbd)โก๏ธ Updated
scrollToObject:
method inIGListAdapter
to include a new parameteradditionalOffset
to handle shifting the final scroll position by some vertical or horizontal offset depending on the scroll direction. This allows the object to be shown at the correct position when it is scrolled to in a list with sticky headers.
// OLD - (void)scrollToObject:(id)object supplementaryKinds:(nullable NSArray<NSString *> *)supplementaryKinds scrollDirection:(UICollectionViewScrollDirection)scrollDirection scrollPosition:(UICollectionViewScrollPosition)scrollPosition animated:(BOOL)animated; // NEW - (void)scrollToObject:(id)object supplementaryKinds:(nullable NSArray<NSString *> *)supplementaryKinds scrollDirection:(UICollectionViewScrollDirection)scrollDirection scrollPosition:(UICollectionViewScrollPosition)scrollPosition additionalOffset:(CGPoint)additionalOffset animated:(BOOL)animated;
โจ Enhancements
โ Added
shouldSelectItemAtIndex:
toIGListSectionController
. dirtmelonโ Added Mac Catalyst support. Petro Rovenskyy
Introduce
IGListSwiftKit
, with Swift refinements fordequeueReusableCellOfClass
methods. Koen Punt (#1388).Added
APPLICATION_EXTENSION_API_ONLY
support forIGListDiffKit
Peter Meyers (#1422)๐ Improved performance by deferring requesting objects from the
IGListAdapterDataSource
until just before diffing is executed. If n updates are coalesced into one, this results in just a single request for objects from the data source. Shipped with experimentIGListExperimentDeferredToObjectCreation
from Ryan Nystrom. Maxime Ollivier (tbd)๐ Improved performance by using
reloadData
when there are too many diffing updates. Shipped with experimentIGListExperimentReloadDataFallback
from Ryan Nystrom. Maxime Ollivier (tbd)๐ Small performance improvement by replacing
NSSet
withNSArray
during the data update to avoid unnecessary hashing, especially when dealing with lots of large objects with non trivial hashes. Maxime Ollivier (tbd)Lazy initialize the
-emptyViewForListAdapter:
Maxime Ollivier (tbd)โก๏ธ Updated
IGListAdapterUpdater
to be safer, more performant, and better organized! Maxime Ollivier (tbd)- Safely handles
[IGListAdapter setDataSource:]
by also invalidating theUICollectionView
data. - Safely handles
[IGListAdapter setCollectionView:]
by cancelling on-going transactions. - Safely handles returning nil
IGListSectionController
fromIGListAdapterDataSource
by dumping objects that don't have a controller before the diffing. - Checks that the
UICollectionView
section count matches theIGListAdapter
before committing the update, otherwise fallback to a reload. - Schedules an update block (
dispatch_async
) only when needed, instead of scheduling on every single call to-performUpdateWithCollectionViewBlock
. - Wraps each update in a
transaction
that can be easily cancelled. - Uses methods instead of blocks to make the callstack easier to read in crash reports.
- Unblocks
IGListExperimentBackgroundDiffing
- Safely handles
๐ Fixes
๐ฆ Repaired Swift Package Manager support. Petro Rovenskyy
๐
IGListCollectionViewLayout
should get the section/index counts viaUICollectionView
to stay in sync, instead of thedataSource
Maxime Ollivier (tbd)โ Remove
[collectionView layoutIfNeeded]
before scrolling in[IGListAdapter scrollToObject...]
to avoid creating off-screen cells. Maxime Ollivier (tbd)โ Remove
[collectionView layoutIfNeeded]
before updating in[IGListAdapterUpdater performBatchUpdates...]
to fix occasional glitches. Maxime Ollivier (tbd)๐ Fixed
IGListAdapterUpdaterDelegate
by 1) callingwillReloadDataWithCollectionView
on fallback reloads and 2) making surewillPerformBatchUpdatesWithCollectionView
is only called when performing a batch update. Maxime Ollivier (tbd)๐ Fixed missing update when calling
performUpdatesAnimated
multiple times quickly and using thereloadDataFallback()
. Maxime Ollivier (tbd)โก๏ธ Request the
UICollectionView
until just-before we update. This way if theUICollectionView
is changed between update-queue and execution, we guarantee the update is performed on the correct view. Ship with experimentIGListExperimentGetCollectionViewAtUpdate
from Ryan Nystrom. Maxime Ollivier (tbd)