# Functions

The following functions are available globally.

- `IGListDiff`

  Creates a diff using indexes between two collections.

  #### Declaration

  Objective-C

      extern IGListIndexSetResult *_Nonnull IGListDiff(
          NSArray<id<IGListDiffable>> *_Nullable oldArray,
          NSArray<id<IGListDiffable>> *_Nullable newArray, IGListDiffOption option)

  #### Parameters

  `oldArray` | The old objects to diff against.
  `newArray` | The new objects.
  `option` | An option on how to compare objects.

  #### Return Value

  A result object containing affected indexes.

- `IGListDiffPaths`

  Creates a diff using index paths between two collections.

  #### Declaration

  Objective-C

      extern IGListIndexPathResult *_Nonnull IGListDiffPaths(
          NSInteger fromSection, NSInteger toSection,
          NSArray<id<IGListDiffable>> *_Nullable oldArray,
          NSArray<id<IGListDiffable>> *_Nullable newArray, IGListDiffOption option)

  #### Parameters

  `fromSection` | The old section.
  `toSection` | The new section.
  `oldArray` | The old objects to diff against.
  `newArray` | The new objects.
  `option` | An option on how to compare objects.

  #### Return Value

  A result object containing affected indexes.

- `IGListExperimentEnabled`

  Check if an experiment is enabled in a bitmask.

  #### Declaration

  Objective-C

      static inline BOOL IGListExperimentEnabled(IGListExperiment mask,
                                                 IGListExperiment option)

  Swift

      func IGListExperimentEnabled(_ mask: IGListExperiment, _ option: IGListExperiment) -> Bool

  #### Parameters

  `mask` | The bitmask of experiments.
  `option` | The option to compare with.

  #### Return Value

  `YES` if the option is in the bitmask, otherwise `NO`.

- `IGListDiffExperiment`

  Performs an index diff with an experiment bitmask.

  See

  `IGListDiff()`.

  #### Declaration

  Objective-C

      extern IGListIndexSetResult *_Nonnull IGListDiffExperiment(
          NSArray<id<IGListDiffable>> *_Nullable oldArray,
          NSArray<id<IGListDiffable>> *_Nullable newArray, IGListDiffOption option,
          IGListExperiment experiments)

  #### Parameters

  `oldArray` | The old array of objects.
  `newArray` | The new array of objects.
  `option` | Option to specify the type of diff.
  `experiments` | Optional experiments.

  #### Return Value

  An index set result object contained the changed indexes.

- `IGListDiffPathsExperiment`

  Performs a index path diff with an experiment bitmask.

  See

  `IGListDiffPaths()`.

  #### Declaration

  Objective-C

      extern IGListIndexPathResult *_Nonnull IGListDiffPathsExperiment(
          NSInteger fromSection, NSInteger toSection,
          NSArray<id<IGListDiffable>> *_Nullable oldArray,
          NSArray<id<IGListDiffable>> *_Nullable newArray, IGListDiffOption option,
          IGListExperiment experiments)

  #### Parameters

  `fromSection` | The old section.
  `toSection` | The new section.
  `oldArray` | The old array of objects.
  `newArray` | The new array of objects.
  `option` | Option to specify the type of diff.
  `experiments` | Optional experiments.

  #### Return Value

  An index path result object containing the changed indexPaths.

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

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