Instance Method

collectionView:willDisplaySupplementaryView:forElementKind:atIndexPath:

Notifies the delegate that the specified supplementary view is about to be displayed by the collection view.

Declaration

- (void)collectionView:(NSCollectionView *)collectionView willDisplaySupplementaryView:(NSView *)view forElementKind:(NSCollectionViewSupplementaryElementKind)elementKind atIndexPath:(NSIndexPath *)indexPath;

Parameters

collectionView

The collection view that is adding the supplementary view.

view

The supplementary view being added.

elementKind

The type of the supplementary view. Layouts are responsible for defining the types of supplementary views they support.

indexPath

The index path associated with the supplementary view.

Discussion

The collection view calls this method before adding new supplementary views to its content. You can use this method to track the addition of those views and perform related tasks.

See Also

Tracking the Addition and Removal of Items

- collectionView:willDisplayItem:forRepresentedObjectAtIndexPath:

Notifies the delegate that the specified item is about to be displayed by the collection view.

- collectionView:didEndDisplayingItem:forRepresentedObjectAtIndexPath:

Notifies the delegate that the specified item was removed from the collection view.

- collectionView:didEndDisplayingSupplementaryView:forElementOfKind:atIndexPath:

Notifies the delegate that the specified supplementary view was removed from the collection view.