Instance Method

indexPathsToInsertForSupplementaryViewOfKind:

Returns an array of index paths for the supplementary views you want to add to the layout.

Declaration

- (NSArray<NSIndexPath *> *)indexPathsToInsertForSupplementaryViewOfKind:(NSString *)elementKind;

Parameters

kind

The specific type of supplementary view.

Return Value

An array of NSIndexPath objects indicating the location of the new supplementary views or an empty array if you do not want to add any supplementary views.

Discussion

The collection view calls this method whenever you add cells or sections to the collection view. Implementing this method gives your layout object an opportunity to add new supplementary views to complement the additions.

The collection view calls this method between its calls to prepareForCollectionViewUpdates: and finalizeCollectionViewUpdates.

See Also

Responding to Collection View Updates

- prepareForCollectionViewUpdates:

Notifies the layout object that the contents of the collection view are about to change.

- finalizeCollectionViewUpdates

Performs any additional animations or clean up needed during a collection view update.

- indexPathsToInsertForDecorationViewOfKind:

Returns an array of index paths representing the decoration views to add.

- initialLayoutAttributesForAppearingItemAtIndexPath:

Returns the starting layout information for an item being inserted into the collection view.

- initialLayoutAttributesForAppearingSupplementaryElementOfKind:atIndexPath:

Returns the starting layout information for a supplementary view being inserted into the collection view.

- initialLayoutAttributesForAppearingDecorationElementOfKind:atIndexPath:

Returns the starting layout information for a decoration view being inserted into the collection view.

- indexPathsToDeleteForSupplementaryViewOfKind:

Returns an array of index paths representing the supplementary views to remove.

- indexPathsToDeleteForDecorationViewOfKind:

Returns an array of index paths representing the decoration views to remove.

- finalLayoutAttributesForDisappearingItemAtIndexPath:

Returns the final layout information for an item that is about to be removed from the collection view.

- finalLayoutAttributesForDisappearingSupplementaryElementOfKind:atIndexPath:

Returns the final layout information for a supplementary view that is about to be removed from the collection view.

- finalLayoutAttributesForDisappearingDecorationElementOfKind:atIndexPath:

Returns the final layout information for a decoration view that is about to be removed from the collection view.

- targetIndexPathForInteractivelyMovingItem:withPosition:

Returns the index path to for an item when it is at the specified location in the collection view’s bounds.