Instance Method


Tells the layout object to update the current layout.


- (void)prepareLayout;


Layout updates occur the first time the collection view presents its content and whenever the layout is invalidated explicitly or implicitly because of a change to the view. During each layout update, the collection view calls this method first to give your layout object a chance to prepare for the upcoming layout operation.

The default implementation of this method does nothing. Subclasses can override it and use it to set up data structures or perform any initial computations needed to perform the layout later.

See Also

Providing Layout Attributes


Returns the class to use when creating layout attributes objects.

- layoutAttributesForElementsInRect:

Returns the layout attributes for all of the cells and views in the specified rectangle.

- layoutAttributesForItemAtIndexPath:

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

- layoutAttributesForInteractivelyMovingItemAtIndexPath:withTargetPosition:

Returns the layout attributes of an item when it is being moved interactively by the user.

- layoutAttributesForSupplementaryViewOfKind:atIndexPath:

Returns the layout attributes for the specified supplementary view.

- layoutAttributesForDecorationViewOfKind:atIndexPath:

Returns the layout attributes for the specified decoration view.

- targetContentOffsetForProposedContentOffset:

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

- targetContentOffsetForProposedContentOffset:withScrollingVelocity:

Returns the point at which to stop scrolling.