# IGListAdapterUpdater Class Reference

# IGListAdapterUpdater

Objective-C

    @interface IGListAdapterUpdater : NSObject <IGListUpdatingDelegate>

Swift

    class ListAdapterUpdater : NSObject, ListUpdatingDelegate

An `IGListAdapterUpdater` is a concrete type that conforms to `IGListUpdatingDelegate`. It is an out-of-box updater for `IGListAdapter` objects to use.

Note

This updater performs re-entrant, coalesced updating for a list. It also uses a least-minimal diff for calculating UI updates when `IGListAdapter` calls `-performUpdateWithCollectionView:fromObjects:toObjects:completion:`.

- `delegate`

  The delegate that receives events with data on the performance of a transition.

  #### Declaration

  Objective-C

      @property (nonatomic, weak) id<IGListAdapterUpdaterDelegate> _Nullable delegate;

  Swift

      weak var delegate: (any ListAdapterUpdaterDelegate)? { get set }

- `sectionMovesAsDeletesInserts`

  A flag indicating if a section move should be treated as a section “delete, then insert” operation. This can be useful if you’re performing a lot of updates and moves are too distracting.

  Default is NO.

  #### Declaration

  Objective-C

      @property (nonatomic) BOOL sectionMovesAsDeletesInserts;

  Swift

      var sectionMovesAsDeletesInserts: Bool { get set }

- `singleItemSectionUpdates`

  ONLY used when there is N section, but each section only contains 1 item. We don’t need to change move into delete+insert, and we dont need to call -reload at all.

  This unlocks many default UICollectionView animations: move/inline cell updates/deletes/inserts etc.

  Default is NO.

  Warning

  This should only work for Section that ONLY has single item setup.

  #### Declaration

  Objective-C

      @property (nonatomic) BOOL singleItemSectionUpdates;

  Swift

      var singleItemSectionUpdates: Bool { get set }

- `preferItemReloadsForSectionReloads`

  A flag indicating that section reloads should be treated as item reloads, instead of converting them to “delete, then insert” operations. This only applies if the number of items for the section is unchanged.

  Default is NO.

  Note

  If the number of items for the section is changed, we would fallback to the default behavior and convert it to “delete + insert”, because the collectionView can crash otherwise.

  #### Declaration

  Objective-C

      @property (nonatomic) BOOL preferItemReloadsForSectionReloads;

  Swift

      var preferItemReloadsForSectionReloads: Bool { get set }

- `allowsReloadingOnTooManyUpdates`

  If there’s more than 100 diff updates, fallback to using `reloadData` to avoid stalling the main thread.

  Default is YES.

  #### Declaration

  Objective-C

      @property (nonatomic) BOOL allowsReloadingOnTooManyUpdates;

  Swift

      var allowsReloadingOnTooManyUpdates: Bool { get set }

- `allowsBackgroundDiffing`

  Allow the diffing to be performed on a background thread.

  Default is NO.

  #### Declaration

  Objective-C

      @property (nonatomic) BOOL allowsBackgroundDiffing;

  Swift

      var allowsBackgroundDiffing: Bool { get set }

- `experiments`

  A bitmask of experiments to conduct on the updater.

  #### Declaration

  Objective-C

      @property (nonatomic) IGListExperiment experiments;

  Swift

      var experiments: IGListExperiment { get set }

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

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