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
listAdapterThe list adapter sending this information.
objectThe object that will display.
indexThe 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
listAdapterThe list adapter sending this information.
objectThe object that ended display.
indexThe 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
listAdapterThe list adapter sending this information.
objectThe object that will display.
cellThe cell which contains the object that will display.
indexPathThe 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
listAdapterThe list adapter sending this information.
objectThe object that ended display.
cellThe cell which contains the object that ended display.
indexPathThe index path of the object in the list.
View on GitHub