indexPathsToDeleteForSupplementaryView(ofKind:)
Retrieves an array of index paths representing the supplementary views to remove.
Declaration
func indexPathsToDeleteForSupplementaryView(ofKind elementKind: String) -> [IndexPath]Parameters
- elementKind:
The specific type of supplementary view.
Return Value
An array of NSIndexPath objects indicating the supplementary views you want to remove or an empty array if you do not want to remove any views of the given kind.
Discussion
The collection view calls this method whenever you delete cells or sections to the collection view. Implementing this method gives your layout object an opportunity to remove any supplementary views that are no longer needed.
The collection view calls this method between its calls to prepare(forCollectionViewUpdates:) and finalizeCollectionViewUpdates().
See Also
Responding to collection view updates
prepare(forCollectionViewUpdates:)finalizeCollectionViewUpdates()indexPathsToInsertForSupplementaryView(ofKind:)indexPathsToInsertForDecorationView(ofKind:)initialLayoutAttributesForAppearingItem(at:)initialLayoutAttributesForAppearingSupplementaryElement(ofKind:at:)initialLayoutAttributesForAppearingDecorationElement(ofKind:at:)indexPathsToDeleteForDecorationView(ofKind:)finalLayoutAttributesForDisappearingItem(at:)finalLayoutAttributesForDisappearingSupplementaryElement(ofKind:at:)finalLayoutAttributesForDisappearingDecorationElement(ofKind:at:)targetIndexPath(forInteractivelyMovingItem:withPosition:)