IGListAdapterUpdaterDelegate
Objective-C
@protocol IGListAdapterUpdaterDelegate <NSObject>
                Swift
protocol ListAdapterUpdaterDelegate : NSObjectProtocol
                A protocol that receives events about IGListAdapterUpdater operations.
- 
                  
                  
Notifies the delegate that the updater is about to beging diffing.
Declaration
Objective-C
- (void)listAdapterUpdater:(nonnull IGListAdapterUpdater *)listAdapterUpdater willDiffFromObjects:(nullable NSArray<id<IGListDiffable>> *)fromObjects toObjects:(nullable NSArray<id<IGListDiffable>> *)toObjects;Swift
func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, willDiffFromObjects fromObjects: [any IGListDiffable]?, toObjects: [any IGListDiffable]?)Parameters
listAdapterUpdaterThe adapter updater owning the transition.
fromObjectsThe items transitioned from in the batch updates, if any.
toObjectsThe items transitioned to in the batch updates, if any.
 - 
                  
                  
Notifies the delegate that the updater finished diffing.
Declaration
Objective-C
- (void)listAdapterUpdater:(nonnull IGListAdapterUpdater *)listAdapterUpdater didDiffWithResults:(nullable IGListIndexSetResult *)listIndexSetResults onBackgroundThread:(BOOL)onBackgroundThread;Swift
func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, didDiffWithResults listIndexSetResults: IGListIndexSetResult?, onBackgroundThread: Bool)Parameters
listAdapterUpdaterThe adapter updater owning the transition.
listIndexSetResultsThe diffing result of indices to be inserted/removed/updated/moved/etc.
onBackgroundThreadWas the diffing performed on a background thread
 - 
                  
-listAdapterUpdater:willPerformBatchUpdatesWithCollectionView: fromObjects: toObjects: listIndexSetResult: animated: Notifies the delegate that the updater will call
-[UICollectionView performBatchUpdates:completion:].Declaration
Objective-C
- (void)listAdapterUpdater:(nonnull IGListAdapterUpdater *)listAdapterUpdater willPerformBatchUpdatesWithCollectionView: (nonnull UICollectionView *)collectionView fromObjects: (nullable NSArray<id<IGListDiffable>> *) fromObjects toObjects: (nullable NSArray<id<IGListDiffable>> *) toObjects listIndexSetResult:(nullable IGListIndexSetResult *) listIndexSetResults animated:(BOOL)animated;Swift
func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, willPerformBatchUpdatesWith collectionView: UICollectionView, fromObjects: [any IGListDiffable]?, toObjects: [any IGListDiffable]?, listIndexSetResult listIndexSetResults: IGListIndexSetResult?, animated: Bool)Parameters
listAdapterUpdaterThe adapter updater owning the transition.
collectionViewThe collection view that will perform the batch updates.
fromObjectsThe items transitioned from in the batch updates, if any.
toObjectsThe items transitioned to in the batch updates, if any.
listIndexSetResultsThe diffing result of indices to be inserted/removed/updated/moved/etc.
animatedIs the cell transtion animated
 - 
                  
                  
Notifies the delegate that the updater successfully finished
-[UICollectionView performBatchUpdates:completion:].Note
This event is called in the completion block of the batch update.
Declaration
Objective-C
- (void)listAdapterUpdater:(nonnull IGListAdapterUpdater *)listAdapterUpdater didPerformBatchUpdates:(nonnull IGListBatchUpdateData *)updates collectionView:(nonnull UICollectionView *)collectionView;Swift
func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, didPerformBatchUpdates updates: ListBatchUpdateData, collectionView: UICollectionView)Parameters
listAdapterUpdaterThe adapter updater owning the transition.
updatesThe batch updates that were applied to the collection view.
collectionViewThe collection view that performed the batch updates.
 - 
                  
                  
Notifies the delegate that the updater will call
-[UICollectionView insertItemsAtIndexPaths:].Note
This event is only sent when outside of
-[UICollectionView performBatchUpdates:completion:].Declaration
Objective-C
- (void)listAdapterUpdater:(nonnull IGListAdapterUpdater *)listAdapterUpdater willInsertIndexPaths:(nonnull NSArray<NSIndexPath *> *)indexPaths collectionView:(nonnull UICollectionView *)collectionView;Swift
func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, willInsert indexPaths: [IndexPath], collectionView: UICollectionView)Parameters
listAdapterUpdaterThe adapter updater owning the transition.
indexPathsAn array of index paths that will be inserted.
collectionViewThe collection view that will perform the insert.
 - 
                  
                  
Notifies the delegate that the updater will call
-[UICollectionView deleteItemsAtIndexPaths:].Note
This event is only sent when outside of
-[UICollectionView performBatchUpdates:completion:].Declaration
Objective-C
- (void)listAdapterUpdater:(nonnull IGListAdapterUpdater *)listAdapterUpdater willDeleteIndexPaths:(nonnull NSArray<NSIndexPath *> *)indexPaths collectionView:(nonnull UICollectionView *)collectionView;Swift
func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, willDelete indexPaths: [IndexPath], collectionView: UICollectionView)Parameters
listAdapterUpdaterThe adapter updater owning the transition.
indexPathsAn array of index paths that will be deleted.
collectionViewThe collection view that will perform the delete.
 - 
                  
                  
Notifies the delegate that the updater will call
-[UICollectionView moveItemAtIndexPath:toIndexPath:]Note
This event is only sent when outside of
-[UICollectionView performBatchUpdates:completion:].Declaration
Objective-C
- (void)listAdapterUpdater:(nonnull IGListAdapterUpdater *)listAdapterUpdater willMoveFromIndexPath:(nonnull NSIndexPath *)fromIndexPath toIndexPath:(nonnull NSIndexPath *)toIndexPath collectionView:(nonnull UICollectionView *)collectionView;Swift
func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, willMoveFrom fromIndexPath: IndexPath, to toIndexPath: IndexPath, collectionView: UICollectionView)Parameters
listAdapterUpdaterThe adapter updater owning the transition.
fromIndexPathThe index path of the item that will be moved.
toIndexPathThe index path to move the item to.
collectionViewThe collection view that will perform the move.
 - 
                  
                  
Notifies the delegate that the updater will call
-[UICollectionView reloadItemsAtIndexPaths:].Note
This event is only sent when outside of
-[UICollectionView performBatchUpdates:completion:].Declaration
Objective-C
- (void)listAdapterUpdater:(nonnull IGListAdapterUpdater *)listAdapterUpdater willReloadIndexPaths:(nonnull NSArray<NSIndexPath *> *)indexPaths collectionView:(nonnull UICollectionView *)collectionView;Swift
func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, willReload indexPaths: [IndexPath], collectionView: UICollectionView)Parameters
listAdapterUpdaterThe adapter updater owning the transition.
indexPathsAn array of index paths that will be reloaded.
collectionViewThe collection view that will perform the reload.
 - 
                  
                  
Notifies the delegate that the updater will call
-[UICollectionView reloadSections:].Note
This event is only sent when outside of
-[UICollectionView performBatchUpdates:completion:].Declaration
Objective-C
- (void)listAdapterUpdater:(nonnull IGListAdapterUpdater *)listAdapterUpdater willReloadSections:(nonnull NSIndexSet *)sections collectionView:(nonnull UICollectionView *)collectionView;Swift
func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, willReloadSections sections: IndexSet, collectionView: UICollectionView)Parameters
listAdapterUpdaterThe adapter updater owning the transition.
sectionsThe sections that will be reloaded
collectionViewThe collection view that will perform the reload.
 - 
                  
                  
Notifies the delegate that the updater will call
-[UICollectionView reloadData].Declaration
Objective-C
- (void)listAdapterUpdater:(nonnull IGListAdapterUpdater *)listAdapterUpdater willReloadDataWithCollectionView:(nonnull UICollectionView *)collectionView isFallbackReload:(BOOL)isFallbackReload;Swift
func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, willReloadDataWith collectionView: UICollectionView, isFallbackReload: Bool)Parameters
listAdapterUpdaterThe adapter updater owning the transition.
collectionViewThe collection view that will be reloaded.
isFallbackReloadThe reload was a fallback because we could not performBatchUpdate
 - 
                  
                  
Notifies the delegate that the updater successfully called
-[UICollectionView reloadData].Declaration
Objective-C
- (void)listAdapterUpdater:(nonnull IGListAdapterUpdater *)listAdapterUpdater didReloadDataWithCollectionView:(nonnull UICollectionView *)collectionView isFallbackReload:(BOOL)isFallbackReload;Swift
func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, didReloadDataWith collectionView: UICollectionView, isFallbackReload: Bool)Parameters
listAdapterUpdaterThe adapter updater owning the transition.
collectionViewThe collection view that reloaded.
isFallbackReloadThe reload was a fallback because we could not performBatchUpdate
 - 
                  
                  
Notifies the delegate that the collection view threw an exception in
-[UICollectionView performBatchUpdates:completion:].Declaration
Objective-C
- (void)listAdapterUpdater:(nonnull IGListAdapterUpdater *)listAdapterUpdater collectionView:(nonnull UICollectionView *)collectionView willCrashWithException:(nonnull NSException *)exception fromObjects:(nullable NSArray *)fromObjects toObjects:(nullable NSArray *)toObjects diffResult:(nonnull IGListIndexSetResult *)diffResult updates:(nonnull IGListBatchUpdateData *)updates;Swift
func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, collectionView: UICollectionView, willCrashWith exception: NSException, from fromObjects: [Any]?, to toObjects: [Any]?, diffResult: IGListIndexSetResult, updates: ListBatchUpdateData)Parameters
listAdapterUpdaterThe adapter updater owning the transition.
collectionViewThe collection view being updated.
exceptionThe exception thrown by the collection view.
fromObjectsThe items transitioned from in the diff, if any.
toObjectsThe items transitioned to in the diff, if any.
diffResultThe diff result that were computed from
fromObjectsandtoObjects.updatesThe batch updates that were applied to the collection view.
 - 
                  
                  
Notifies the delegate that the updater finished without performing any batch updates or reloads
Declaration
Objective-C
- (void)listAdapterUpdater:(nonnull IGListAdapterUpdater *)listAdapterUpdater didFinishWithoutUpdatesWithCollectionView: (nullable UICollectionView *)collectionView;Swift
func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, didFinishWithoutUpdatesWith collectionView: UICollectionView?)Parameters
listAdapterUpdaterThe adapter updater owning the transition.
collectionViewThe collection view that reloaded.
 
View on GitHub