Instance Method

prepareLayout

Prepares the layout object to begin laying out content.

Declaration

- (void)prepareLayout;

Discussion

The default implementation of this method does nothing. During the layout cycle, the collection view calls this method first to give you a chance to prepare any data needed during the layout operation. When defining a custom layout, you can override this method and use it to set up data structures or perform any initial computations needed to perform the layout later.

See Also

Providing Layout Information

layoutAttributesClass

Returns the class to use for layout attribute objects

collectionViewContentSize

The width and height of the collection view’s contents.

- layoutAttributesForElementsInRect:

Returns the layout attribute objects for all items and views in the specified rectangle.

- layoutAttributesForItemAtIndexPath:

Returns the layout attributes for the item at the specified index path.

- layoutAttributesForSupplementaryViewOfKind:atIndexPath:

Returns the layout attributes of the supplementary view at the specified location in your layout.

- layoutAttributesForDecorationViewOfKind:atIndexPath:

Returns the layout attributes of the decoration view at the specified location in your layout.

- layoutAttributesForDropTargetAtPoint:

Returns layout attributes for the drop target at the specified point.

- layoutAttributesForInterItemGapBeforeIndexPath:

Returns layout attributes for the inter-item gap at the specified location in your layout.

- targetContentOffsetForProposedContentOffset:

Returns the offset value to use after an animated layout update or change.

- targetContentOffsetForProposedContentOffset:withScrollingVelocity:

Returns the offset value to use for the collection view’s content at the end of scrolling.