Instance Method

shouldInvalidateLayoutForBoundsChange:

Asks the layout object if the new bounds require a layout update.

Declaration

- (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds;

Parameters

newBounds

The new bounds of the collection view.

Return Value

YES if the collection view requires a layout update or NO if the layout does not need to change.

Discussion

The default implementation of this method returns NO. Subclasses can override it and return an appropriate value based on whether changes in the bounds of the collection view require changes to the layout of cells and supplementary views.

If the bounds of the collection view change and this method returns YES, the collection view invalidates the layout by calling the invalidateLayoutWithContext: method.

See Also

Invalidating the Layout

- invalidateLayout

Invalidates the current layout and triggers a layout update.

- invalidateLayoutWithContext:

Invalidates the current layout using the information in the provided context object.

invalidationContextClass

Returns the class to use when creating an invalidation context for the layout.

- invalidationContextForBoundsChange:

Returns a context object that defines the portions of the layout that should change when a bounds change occurs.

- shouldInvalidateLayoutForPreferredLayoutAttributes:withOriginalAttributes:

Asks the layout object if changes to a self-sizing cell require a layout update.

- invalidationContextForPreferredLayoutAttributes:withOriginalAttributes:

Returns a context object that identifies the portions of the layout that should change in response to dynamic cell changes.

- invalidationContextForInteractivelyMovingItems:withTargetPosition:previousIndexPaths:previousPosition:

Returns a context object that identifies the items that are being interactively moved in the layout.