# IGListUpdatingDelegate

    @protocol IGListUpdatingDelegate

Implement this protocol in order to handle both section and row based update events. Implementation should forward or coalesce these events to a backing store or collection.

- `-objectLookupPointerFunctions`

  Asks the delegate for the pointer functions for looking up an object in a collection.

  Note

  Since the updating delegate is responsible for transitioning between object sets, it becomes the source of truth for how objects and their corresponding section controllers are mapped. This allows the updater to control if objects are looked up by pointer, or more traditionally, with `-hash`/`-isEqual`.

  For behavior similar to `NSDictionary`, simply return `+[NSPointerFunctions pointerFunctionsWithOptions:NSPointerFunctionsObjectPersonality]`.

  #### Declaration

  Objective-C

      - (nonnull NSPointerFunctions *)objectLookupPointerFunctions;

  Swift

      func objectLookupPointerFunctions() -> Any!

  #### Return Value

  Pointer functions for looking up an object in a collection.

- `-performUpdateWithCollectionView:fromObjects:toObjects:animated:objectTransitionBlock:completion:`

  Tells the delegate to perform a section transition from an old array of objects to a new one.

  Note

  Implementations determine how to transition between objects. You can perform a diff on the objects, reload each section, or simply call `-reloadData` on the collection view. In the end, the collection view must be setup with a section for each object in the `toObjects` array.

  The `objectTransitionBlock` block should be called prior to making any `UICollectionView` updates, passing in the `toObjects` that the updater is applying.

  #### Declaration

  Objective-C

      - (void)
      performUpdateWithCollectionView:(nonnull UICollectionView *)collectionView
                          fromObjects:
                              (nullable NSArray<id<IGListDiffable>> *)fromObjects
                            toObjects:
                                (nullable NSArray<id<IGListDiffable>> *)toObjects
                             animated:(BOOL)animated
                objectTransitionBlock:
                    (nonnull IGListObjectTransitionBlock)objectTransitionBlock
                           completion:(nullable IGListUpdatingCompletion)completion;

  Swift

      func performUpdate(withCollectionView collectionView: Any!, fromObjects: Any!, toObjects: Any!, animated: Any!, objectTransitionBlock: IGListObjectTransitionBlock!, completion: Any!)

  #### Parameters

  `collectionView` | The collection view to perform the transition on.
  `fromObjects` | The previous objects in the collection view. Objects must conform to `IGListDiffable`.
  `toObjects` | The new objects in collection view. Objects must conform to `IGListDiffable`.
  `animated` | A flag indicating if the transition should be animated.
  `objectTransitionBlock` | A block that must be called when the adapter applies changes to the collection view.
  `completion` | A completion block to execute when the update is finished.

- `-insertItemsIntoCollectionView:indexPaths:`

  Tells the delegate to perform item inserts at the given index paths.

  #### Declaration

  Objective-C

      - (void)insertItemsIntoCollectionView:(nonnull UICollectionView *)collectionView
                                 indexPaths:
                                     (nonnull NSArray<NSIndexPath *> *)indexPaths;

  Swift

      func insertItems(intoCollectionView collectionView: Any!, indexPaths: Any!)

  #### Parameters

  `collectionView` | The collection view on which to perform the transition.
  `indexPaths` | The index paths to insert items into.

- `-deleteItemsFromCollectionView:indexPaths:`

  Tells the delegate to perform item deletes at the given index paths.

  #### Declaration

  Objective-C

      - (void)deleteItemsFromCollectionView:(nonnull UICollectionView *)collectionView
                                 indexPaths:
                                     (nonnull NSArray<NSIndexPath *> *)indexPaths;

  Swift

      func deleteItems(fromCollectionView collectionView: Any!, indexPaths: Any!)

  #### Parameters

  `collectionView` | The collection view on which to perform the transition.
  `indexPaths` | The index paths to delete items from.

- `-reloadItemsInCollectionView:indexPaths:`

  Tells the delegate to perform item reloads at the given index paths.

  #### Declaration

  Objective-C

      - (void)reloadItemsInCollectionView:(nonnull UICollectionView *)collectionView
                               indexPaths:
                                   (nonnull NSArray<NSIndexPath *> *)indexPaths;

  Swift

      func reloadItems(inCollectionView collectionView: Any!, indexPaths: Any!)

  #### Parameters

  `collectionView` | The collection view on which to perform the transition.
  `indexPaths` | The index paths of items to reload.

- `-reloadDataWithCollectionView:reloadUpdateBlock:completion:`

  Completely reload data in the collection.

  #### Declaration

  Objective-C

      - (void)
      reloadDataWithCollectionView:(nonnull UICollectionView *)collectionView
                 reloadUpdateBlock:(nonnull IGListReloadUpdateBlock)reloadUpdateBlock
                        completion:(nullable IGListUpdatingCompletion)completion;

  Swift

      func reloadData(withCollectionView collectionView: Any!, reloadUpdate reloadUpdateBlock: IGListReloadUpdateBlock!, completion: Any!)

  #### Parameters

  `collectionView` | The collection view to reload.
  `reloadUpdateBlock` | A block that must be called when the adapter reloads the collection view.
  `completion` | A completion block to execute when the reload is finished.

- `-reloadCollectionView:sections:`

  Completely reload each section in the collection view.

  #### Declaration

  Objective-C

      - (void)reloadCollectionView:(nonnull UICollectionView *)collectionView
                          sections:(nonnull NSIndexSet *)sections;

  Swift

      func reloadCollectionView(_ collectionView: Any!, sections: Any!)

  #### Parameters

  `collectionView` | The collection view to reload.
  `sections` | The sections to reload.

- `-performUpdateWithCollectionView:animated:itemUpdates:completion:`

  Perform an item update block in the collection view.

  #### Declaration

  Objective-C

      - (void)
      performUpdateWithCollectionView:(nonnull UICollectionView *)collectionView
                             animated:(BOOL)animated
                          itemUpdates:(nonnull IGListItemUpdateBlock)itemUpdates
                           completion:(nullable IGListUpdatingCompletion)completion;

  Swift

      func performUpdate(withCollectionView collectionView: Any!, animated: Any!, itemUpdates: IGListItemUpdateBlock!, completion: Any!)

  #### Parameters

  `collectionView` | The collection view to update.
  `animated` | A flag indicating if the transition should be animated.
  `itemUpdates` | A block containing all of the updates.
  `completion` | A completion block to execute when the update is finished.

© 2017 Instagram. All rights reserved. (Last updated: 2017-01-04)

Generated by jazzy ♪♫ v0.7.3, a Realm project.