Instance Method

finalLayoutAttributesForDisappearingSupplementaryElementOfKind:atIndexPath:

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

Declaration

- (NSCollectionViewLayoutAttributes *)finalLayoutAttributesForDisappearingSupplementaryElementOfKind:(NSCollectionViewSupplementaryElementKind)elementKind atIndexPath:(NSIndexPath *)elementIndexPath;

Parameters

elementKind

The type of the decoration view being removed.

elementIndexPath

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

Return Value

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

Discussion

When your layout object removes supplementary views in response to other changes in the collection view, the collection view calls this method for each supplementary 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 supplementary 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 supplementary 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

- prepareForCollectionViewUpdates:

Performs needed tasks before items are inserted, deleted, or moved within the collection view.

- finalizeCollectionViewUpdates

Performs needed steps after items are inserted, deleted, or moved within a collection view.

- indexPathsToInsertForSupplementaryViewOfKind:

Returns the index paths for any supplementary views that the layout object wants to add to the collection view.

- indexPathsToInsertForDecorationViewOfKind:

Returns the index paths for any decoration views that the layout object wants to add to the collection view.

- initialLayoutAttributesForAppearingItemAtIndexPath:

Returns the starting layout information for an item being inserted into the collection view.

- initialLayoutAttributesForAppearingSupplementaryElementOfKind:atIndexPath:

Returns the starting layout information for a supplementary view being added to the collection view.

- initialLayoutAttributesForAppearingDecorationElementOfKind:atIndexPath:

Returns the starting layout information for a decoration view being added to the collection view.

- indexPathsToDeleteForSupplementaryViewOfKind:

Returns the index paths for any supplementary views that the layout object wants to remove from the collection view.

- indexPathsToDeleteForDecorationViewOfKind:

Returns index paths for any decoration views that the layout object wants to remove from the collection view.

- finalLayoutAttributesForDisappearingItemAtIndexPath:

Returns the ending layout information for an item being removed from the collection view.

- finalLayoutAttributesForDisappearingDecorationElementOfKind:atIndexPath:

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