Class

UICollectionReusableView

A view that defines the behavior for all cells and supplementary views presented by a collection view.

Declaration

@interface UICollectionReusableView : UIView

Overview

Reusable views are so named because the collection view places them on a reuse queue rather than deleting them when they are scrolled out of the visible bounds. Such a view can then be retrieved and repurposed for a different set of content.

Subclassing Notes

This class is intended to be subclassed. Most methods defined by this class have minimal or no implementations. You are not required to override any of the methods but can do so in cases where you want to respond to changes in the view’s usage or layout.

Topics

Reusing Cells

reuseIdentifier

A string that identifies the purpose of the view.

- prepareForReuse

Performs any clean up necessary to prepare the view for use again.

Managing Layout Changes

- preferredLayoutAttributesFittingAttributes:

Gives the cell a chance to modify the attributes provided by the layout object.

- applyLayoutAttributes:

Applies the specified layout attributes to the view.

- willTransitionFromLayout:toLayout:

Tells your view that the layout object of the collection view is about to change.

- didTransitionFromLayout:toLayout:

Tells your view that the layout object of the collection view changed.

Relationships

Inherits From

See Also

Cells

UICollectionViewCell

A single data item when that item is within the collection view’s visible bounds.