IGListAdapterDelegate

Objective-C

@protocol IGListAdapterDelegate <NSObject>

Swift

@MainActor protocol ListAdapterDelegate : NSObjectProtocol

Conform to IGListAdapterDelegate to receive display events for objects in a list.

  • Notifies the delegate that a list object is about to be displayed.

    Declaration

    Objective-C

    - (void)listAdapter:(nonnull IGListAdapter *)listAdapter
        willDisplayObject:(nonnull id)object
                  atIndex:(NSInteger)index;

    Swift

    func listAdapter(_ listAdapter: IGListAdapter, willDisplay object: Any, at index: Int)

    Parameters

    listAdapter

    The list adapter sending this information.

    object

    The object that will display.

    index

    The index of the object in the list.

  • Notifies the delegate that a list object is no longer being displayed.

    Declaration

    Objective-C

    - (void)listAdapter:(nonnull IGListAdapter *)listAdapter
        didEndDisplayingObject:(nonnull id)object
                       atIndex:(NSInteger)index;

    Swift

    func listAdapter(_ listAdapter: IGListAdapter, didEndDisplaying object: Any, at index: Int)

    Parameters

    listAdapter

    The list adapter sending this information.

    object

    The object that ended display.

    index

    The index of the object in the list.

  • Notifies the delegate that a list object is about to be displayed. This method is distinct from willDisplayObject:atIndex because this method gets called whenever a cell will be displayed on screen as opposed to willDisplayObject:atIndex which only gets called for once per section.

    Declaration

    Objective-C

    - (void)listAdapter:(nonnull IGListAdapter *)listAdapter
        willDisplayObject:(nonnull id)object
                     cell:(nonnull UICollectionViewCell *)cell
              atIndexPath:(nonnull NSIndexPath *)indexPath;

    Swift

    func listAdapter(_ listAdapter: IGListAdapter, willDisplay object: Any, cell: UICollectionViewCell, at indexPath: IndexPath)

    Parameters

    listAdapter

    The list adapter sending this information.

    object

    The object that will display.

    cell

    The cell which contains the object that will display.

    indexPath

    The index path of the object in the list.

  • Notifies the delegate that a list object is no longer being displayed. This method is distinct from didEndDisplayingObject:atIndex because this method gets called whenever a cell ends display on screen as opposed to didEndDisplayingObject:atIndex which only gets called once when the section fully ends display.

    Declaration

    Objective-C

    - (void)listAdapter:(nonnull IGListAdapter *)listAdapter
        didEndDisplayingObject:(nonnull id)object
                          cell:(nonnull UICollectionViewCell *)cell
                   atIndexPath:(nonnull NSIndexPath *)indexPath;

    Swift

    func listAdapter(_ listAdapter: IGListAdapter, didEndDisplaying object: Any, cell: UICollectionViewCell, at indexPath: IndexPath)

    Parameters

    listAdapter

    The list adapter sending this information.

    object

    The object that ended display.

    cell

    The cell which contains the object that ended display.

    indexPath

    The index path of the object in the list.