# Type Definitions Reference

# Type Definitions

The following type definitions are available globally.

- `IGListUpdaterCompletion`

  A block to execute when the list updates are completed.

  #### Declaration

  Objective-C

      typedef void (^IGListUpdaterCompletion)(BOOL)

  Swift

      typealias ListUpdaterCompletion = (Bool) -> Void

  #### Parameters

  `finished` | Specifies whether or not the update animations completed successfully.

- `IGListCollectionScrollingTraits`

  The current scrolling traits of the underlying collection view. The attributes are always equal to their corresponding properties on the underlying collection view.

  See more

  #### Declaration

  Objective-C

      typedef struct IGListCollectionScrollingTraits IGListCollectionScrollingTraits

- `IGListSingleSectionCellConfigureBlock`

  A block used to configure cells.

  #### Declaration

  Objective-C

      typedef void (^IGListSingleSectionCellConfigureBlock)(
          id _Nonnull, __kindof UICollectionViewCell *_Nonnull)

  Swift

      typealias ListSingleSectionCellConfigureBlock = (Any, UICollectionViewCell) -> Void

  #### Parameters

  `item` | The model with which to configure the cell.
  `cell` | The cell to configure.

- `IGListSingleSectionCellSizeBlock`

  A block that returns the size for the cell given the collection context.

  #### Declaration

  Objective-C

      typedef CGSize (^IGListSingleSectionCellSizeBlock)(
          id _Nonnull, id<IGListCollectionContext> _Nullable)

  Swift

      typealias ListSingleSectionCellSizeBlock = (Any, (any ListCollectionContext)?) -> CGSize

  #### Parameters

  `item` | The model for the section.
  `collectionContext` | The collection context for the section.

  #### Return Value

  The size for the cell.

- `IGListUpdatingCompletion`

  A completion block to execute when updates are finished.

  #### Declaration

  Objective-C

      typedef void (^IGListUpdatingCompletion)(BOOL)

  Swift

      typealias ListUpdatingCompletion = (Bool) -> Void

  #### Parameters

  `finished` | Specifies whether or not the update finished.

- `IGListObjectTransitionBlock`

  A block to be called when the adapter applies changes to the collection view.

  #### Declaration

  Objective-C

      typedef void (^IGListObjectTransitionBlock)(NSArray *_Nonnull)

  Swift

      typealias ListObjectTransitionBlock = ([Any]) -> Void

  #### Parameters

  `toObjects` | The new objects in the collection.

- `IGListItemUpdateBlock`

  A block that contains all of the updates.

  #### Declaration

  Objective-C

      typedef void (^IGListItemUpdateBlock)(void)

  Swift

      typealias ListItemUpdateBlock = () -> Void

- `IGListReloadUpdateBlock`

  A block to be called when an adapter reloads the collection view.

  #### Declaration

  Objective-C

      typedef void (^IGListReloadUpdateBlock)(void)

  Swift

      typealias ListReloadUpdateBlock = () -> Void

- `IGListToObjectBlock`

  A block that returns an array of objects to transition to.

  #### Declaration

  Objective-C

      typedef NSArray *_Nullable (^IGListToObjectBlock)(void)

  Swift

      typealias ListToObjectBlock = () -> [Any]?

- `IGListCollectionViewBlock`

  A block that returns a collection view to perform updates on.

  #### Declaration

  Objective-C

      typedef UICollectionView *_Nullable (^IGListCollectionViewBlock)(void)

  Swift

      typealias ListCollectionViewBlock = () -> UICollectionView?

- `IGListDataSourceChangeBlock`

  A block that applies a `UICollectionView` dataSource change

  #### Declaration

  Objective-C

      typedef void (^IGListDataSourceChangeBlock)(void)

  Swift

      typealias ListDataSourceChangeBlock = () -> Void

- `IGListTransitionDataBlock`

  A block that returns the `IGListTransitionData` needed before an update.

  #### Declaration

  Objective-C

      typedef IGListTransitionData *_Nullable (^IGListTransitionDataBlock)(void)

  Swift

      typealias ListTransitionDataBlock = () -> IGListTransitionData?

- `IGListTransitionDataApplyBlock`

  A block to be called when the adapter applies changes to the collection view.

  #### Declaration

  Objective-C

      typedef void (^IGListTransitionDataApplyBlock)(IGListTransitionData *_Nonnull)

  Swift

      typealias ListTransitionDataApplyBlock = (IGListTransitionData) -> Void

  #### Parameters

  `data` | The new data that contains the from/to objects.

© 2024 Instagram. All rights reserved. (Last updated: 2024-05-13)

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