finalLayoutAttributesForDisappearingDecorationElement(ofKind:at:)
Retrieves the final layout information for a decoration view that is about to be removed from the collection view.
Declaration
func finalLayoutAttributesForDisappearingDecorationElement(ofKind elementKind: String, at decorationIndexPath: IndexPath) -> UICollectionViewLayoutAttributes?Parameters
- elementKind:
A string that identifies the type of decoration view.
- decorationIndexPath:
The index path of the view being deleted.
Return Value
A layout attributes object that describes the position of the decoration view to use as the end point for animating its removal.
Discussion
This method is called after the prepare(forCollectionViewUpdates:) method and before the finalizeCollectionViewUpdates() method for any decoration views that are about to be deleted. Your implementation should return the layout information that describes the final position and state of the view. The collection view uses this information as the end point for any animations. (The starting point of the animation is the view’s current location.) If you return nil, the layout object uses the same attributes for both the start and end points of the animation.
The default implementation of this method returns nil.
See Also
Responding to collection view updates
prepare(forCollectionViewUpdates:)finalizeCollectionViewUpdates()indexPathsToInsertForSupplementaryView(ofKind:)indexPathsToInsertForDecorationView(ofKind:)initialLayoutAttributesForAppearingItem(at:)initialLayoutAttributesForAppearingSupplementaryElement(ofKind:at:)initialLayoutAttributesForAppearingDecorationElement(ofKind:at:)indexPathsToDeleteForSupplementaryView(ofKind:)indexPathsToDeleteForDecorationView(ofKind:)finalLayoutAttributesForDisappearingItem(at:)finalLayoutAttributesForDisappearingSupplementaryElement(ofKind:at:)targetIndexPath(forInteractivelyMovingItem:withPosition:)