Instance Method

shouldInvalidateLayoutForBoundsChange:

Returns a Boolean indicating whether a bounds change triggers a layout update.

Declaration

- (BOOL)shouldInvalidateLayoutForBoundsChange:(NSRect)newBounds;

Parameters

newBounds

The new bounds of the collection view.

Return Value

YES if a layout should be invalidated or NO if the layout is still valid.

Discussion

The default implementation of this method returns NO. You can override this method in your custom layout classes and return a different value as needed. Your implementation of the method should determine if the new bounds would cause changes to the layout of other portions of the collection view.

If you return YES from this method, the collection view invalidates the layout using the invalidateLayoutWithContext: method. The invalidation context passed to that method is created using the invalidationContextForBoundsChange: method.

See Also

Invalidating the Layout

- invalidateLayout

Invalidates all layout information and triggers a layout update.

- invalidateLayoutWithContext:

Invalidates specific parts of the layout using the specified context object.

invalidationContextClass

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

- shouldInvalidateLayoutForPreferredLayoutAttributes:withOriginalAttributes:

Returns a Boolean indicating whether changes to a cell’s layout attributes trigger a larger layout update.

- invalidationContextForBoundsChange:

Returns an invalidation context object that defines the portions of the layout that need to be updated.

- invalidationContextForPreferredLayoutAttributes:withOriginalAttributes:

Returns an invalidation context object that defines the portions of the layout that need to be updated.