IGListAdapterUpdaterDelegate

@protocol IGListAdapterUpdaterDelegate <NSObject>

A protocol that receives events about IGListAdapterUpdater operations.

  • 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;

    Parameters

    listAdapterUpdater

    The adapter updater owning the transition.

    collectionView

    The collection view that will perform the batch updates.

    fromObjects

    The items transitioned from in the batch updates, if any.

    toObjects

    The items transitioned to in the batch updates, if any.

    listIndexSetResults

    The diffing result of indices to be inserted/removed/updated/moved/etc.

  • 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

    listAdapterUpdater

    The adapter updater owning the transition.

    updates

    The batch updates that were applied to the collection view.

    collectionView

    The 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

    listAdapterUpdater

    The adapter updater owning the transition.

    indexPaths

    An array of index paths that will be inserted.

    collectionView

    The 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

    listAdapterUpdater

    The adapter updater owning the transition.

    indexPaths

    An array of index paths that will be deleted.

    collectionView

    The 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

    listAdapterUpdater

    The adapter updater owning the transition.

    fromIndexPath

    The index path of the item that will be moved.

    toIndexPath

    The index path to move the item to.

    collectionView

    The 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

    listAdapterUpdater

    The adapter updater owning the transition.

    indexPaths

    An array of index paths that will be reloaded.

    collectionView

    The 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

    listAdapterUpdater

    The adapter updater owning the transition.

    sections

    The sections that will be reloaded

    collectionView

    The 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;

    Swift

    func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, willReloadDataWith collectionView: UICollectionView)

    Parameters

    listAdapterUpdater

    The adapter updater owning the transition.

    collectionView

    The collection view that will be reloaded.

  • Notifies the delegate that the updater successfully called -[UICollectionView reloadData].

    Declaration

    Objective-C

    - (void)listAdapterUpdater:(nonnull IGListAdapterUpdater *)listAdapterUpdater
        didReloadDataWithCollectionView:(nonnull UICollectionView *)collectionView;

    Swift

    func listAdapterUpdater(_ listAdapterUpdater: IGListAdapterUpdater, didReloadDataWith collectionView: UICollectionView)

    Parameters

    listAdapterUpdater

    The adapter updater owning the transition.

    collectionView

    The collection view that reloaded.

  • 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

    listAdapterUpdater

    The adapter updater owning the transition.

    collectionView

    The collection view being updated.

    exception

    The exception thrown by the collection view.

    fromObjects

    The items transitioned from in the diff, if any.

    toObjects

    The items transitioned to in the diff, if any.

    diffResult

    The diff result that were computed from fromObjects and toObjects.

    updates

    The batch updates that were applied to the collection view.