Contents

indexPathsToInsertForSupplementaryView(ofKind:)

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

Declaration

func indexPathsToInsertForSupplementaryView(ofKind elementKind: String) -> [IndexPath]

Parameters

  • elementKind:

    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 don’t 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 prepare(forCollectionViewUpdates:) and finalizeCollectionViewUpdates().

See Also

Responding to collection view updates