Instance Method


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


func invalidateLayout(with context: UICollectionViewLayoutInvalidationContext)



The context object indicating which parts of the layout to refresh.


The default implementation of this method optimizes the layout process using the base properties of the UICollectionViewLayoutInvalidationContext class. If you define a custom context object for your layout, override this method and apply any custom properties of the context object to your layout computations.

If you override this method, you must call super at some point in your implementation.

See Also

Invalidating the Layout

func invalidateLayout()

Invalidates the current layout and triggers a layout update.

class var invalidationContextClass: AnyClass

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

func shouldInvalidateLayout(forBoundsChange: CGRect) -> Bool

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

func invalidationContext(forBoundsChange: CGRect) -> UICollectionViewLayoutInvalidationContext

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