invalidateLayout()
Invalidates the current layout and triggers a layout update.
Declaration
func invalidateLayout()Discussion
You can call this method at any time to update the layout information. This method invalidates the layout of the collection view itself and returns right away. Thus, you can call this method multiple times from the same block of code without triggering multiple layout updates. The actual layout update occurs during the next view layout update cycle.
If you override this method, you must call super at some point in your implementation.
See Also
Invalidating the layout
invalidateLayout(with:)invalidationContextClassshouldInvalidateLayout(forBoundsChange:)invalidationContext(forBoundsChange:)shouldInvalidateLayout(forPreferredLayoutAttributes:withOriginalAttributes:)invalidationContext(forPreferredLayoutAttributes:withOriginalAttributes:)invalidationContext(forInteractivelyMovingItems:withTargetPosition:previousIndexPaths:previousPosition:)invalidationContextForEndingInteractiveMovementOfItems(toFinalIndexPaths:previousIndexPaths:movementCancelled:)