Contents

finalLayoutAttributesForDisappearingDecorationElement(ofKind:at:)

Returns the ending layout information for a decoration view being removed from the collection view.

Declaration

func finalLayoutAttributesForDisappearingDecorationElement(ofKind elementKind: NSCollectionView.DecorationElementKind, at decorationIndexPath: IndexPath) -> NSCollectionViewLayoutAttributes?

Parameters

  • elementKind:

    The type of the decoration view being removed.

  • decorationIndexPath:

    The index path of the decoration view being removed. You can use this path to identify the view internally.

Return Value

The layout attributes object that describes the decoration view’s position and properties at the end of animations.

Discussion

When your layout object removes decoration views in response to other changes in the collection view, the collection view calls this method for each decoration view you remove. Use this method to specify the layout attributes for the view after it has been removed. For example, you might return attributes that position the decoration view offscreen or set its alpha to 0. The collection view uses the attributes you return as the end point for any animations. (The start point of the animation is the view’s current location and attributes.) If you return nil, the layout uses the decoration view’s current attributes for both the start point and end point of the animation.

The default implementation of this method returns nil. Subclasses are expected to override this method, as needed, and provide any initial attributes.

See Also

Responding to Collection View Updates