# IGListBatchUpdateData Class Reference

# IGListBatchUpdateData

    @interface IGListBatchUpdateData : NSObject

An instance of `IGListBatchUpdateData` takes section indexes and item index paths and performs cleanup on init in order to perform a crash-free update via `-[UICollectionView performBatchUpdates:completion:]`.

- `insertSections`

  Section insert indexes.

  #### Declaration

  Objective-C

      @property (readonly, strong, nonatomic) NSIndexSet *_Nonnull insertSections;

  Swift

      var insertSections: IndexSet { get }

- `deleteSections`

  Section delete indexes.

  #### Declaration

  Objective-C

      @property (readonly, strong, nonatomic) NSIndexSet *_Nonnull deleteSections;

  Swift

      var deleteSections: IndexSet { get }

- `moveSections`

  Section moves.

  #### Declaration

  Objective-C

      @property (readonly, strong, nonatomic)
          NSSet<IGListMoveIndex *> *_Nonnull moveSections;

  Swift

      var moveSections: Set<ListMoveIndex> { get }

- `insertIndexPaths`

  Item insert index paths.

  #### Declaration

  Objective-C

      @property (readonly, strong, nonatomic)
          NSArray<NSIndexPath *> *_Nonnull insertIndexPaths;

  Swift

      var insertIndexPaths: [IndexPath] { get }

- `deleteIndexPaths`

  Item delete index paths.

  #### Declaration

  Objective-C

      @property (readonly, strong, nonatomic)
          NSArray<NSIndexPath *> *_Nonnull deleteIndexPaths;

  Swift

      var deleteIndexPaths: [IndexPath] { get }

- `updateIndexPaths`

  Item update index paths.

  #### Declaration

  Objective-C

      @property (readonly, strong, nonatomic)
          NSArray<NSIndexPath *> *_Nonnull updateIndexPaths;

  Swift

      var updateIndexPaths: [IndexPath] { get }

- `moveIndexPaths`

  Item moves.

  #### Declaration

  Objective-C

      @property (readonly, strong, nonatomic)
          NSArray<IGListMoveIndexPath *> *_Nonnull moveIndexPaths;

  Swift

      var moveIndexPaths: [ListMoveIndexPath] { get }

- `-initWithInsertSections:deleteSections:moveSections:insertIndexPaths:deleteIndexPaths:updateIndexPaths:moveIndexPaths:fixIndexPathImbalance:`

  Creates a new batch update object with section and item operations.

  #### Declaration

  Objective-C

      - (nonnull instancetype)
          initWithInsertSections:(nonnull NSIndexSet *)insertSections
                  deleteSections:(nonnull NSIndexSet *)deleteSections
                    moveSections:(nonnull NSSet<IGListMoveIndex *> *)moveSections
                insertIndexPaths:(nonnull NSArray<NSIndexPath *> *)insertIndexPaths
                deleteIndexPaths:(nonnull NSArray<NSIndexPath *> *)deleteIndexPaths
                updateIndexPaths:(nonnull NSArray<NSIndexPath *> *)updateIndexPaths
                  moveIndexPaths:
                      (nonnull NSArray<IGListMoveIndexPath *> *)moveIndexPaths
           fixIndexPathImbalance:(BOOL)fixIndexPathImbalance;

  Swift

      init(insertSections: IndexSet, deleteSections: IndexSet, moveSections: Set<ListMoveIndex>, insert insertIndexPaths: [IndexPath], delete deleteIndexPaths: [IndexPath], update updateIndexPaths: [IndexPath], moveIndexPaths: [ListMoveIndexPath], fixIndexPathImbalance: Bool)

  #### Parameters

  `insertSections` | Section indexes to insert.
  `deleteSections` | Section indexes to delete.
  `moveSections` | Section moves.
  `insertIndexPaths` | Item index paths to insert.
  `deleteIndexPaths` | Item index paths to delete.
  `updateIndexPaths` | Item index paths to update.
  `moveIndexPaths` | Item index paths to move.
  `fixIndexPathImbalance` | When enabled, we remove duplicate NSIndexPath inserts to avoid insert/delete imbalance and a crash.

  #### Return Value

  A new batch update object.

- `-initWithInsertSections:deleteSections:moveSections:insertIndexPaths:deleteIndexPaths:updateIndexPaths:moveIndexPaths:`

  Convenience initializer with fixIndexPathImbalance disabled.

  #### Declaration

  Objective-C

      - (nonnull instancetype)
          initWithInsertSections:(nonnull NSIndexSet *)insertSections
                  deleteSections:(nonnull NSIndexSet *)deleteSections
                    moveSections:(nonnull NSSet<IGListMoveIndex *> *)moveSections
                insertIndexPaths:(nonnull NSArray<NSIndexPath *> *)insertIndexPaths
                deleteIndexPaths:(nonnull NSArray<NSIndexPath *> *)deleteIndexPaths
                updateIndexPaths:(nonnull NSArray<NSIndexPath *> *)updateIndexPaths
                  moveIndexPaths:
                      (nonnull NSArray<IGListMoveIndexPath *> *)moveIndexPaths;

  Swift

      convenience init(insertSections: IndexSet, deleteSections: IndexSet, moveSections: Set<ListMoveIndex>, insert insertIndexPaths: [IndexPath], delete deleteIndexPaths: [IndexPath], update updateIndexPaths: [IndexPath], moveIndexPaths: [ListMoveIndexPath])

© 2019 Instagram. All rights reserved. (Last updated: 2019-11-20)

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