finalLayoutAttributesForDisappearingItem(at:)
Retrieves the final layout information for an item that is about to be removed from the collection view.
Declaration
func finalLayoutAttributesForDisappearingItem(at itemIndexPath: IndexPath) -> UICollectionViewLayoutAttributes?Parameters
- itemIndexPath:
The index path of the item being deleted.
Return Value
A layout attributes object that describes the position of the cell 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 items that are about to be deleted. Your implementation should return the layout information that describes the final position and state of the item. The collection view uses this information as the end point for any animations. (The starting point of the animation is the item’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:)finalLayoutAttributesForDisappearingSupplementaryElement(ofKind:at:)finalLayoutAttributesForDisappearingDecorationElement(ofKind:at:)targetIndexPath(forInteractivelyMovingItem:withPosition:)