---
title: "shouldInvalidateLayout(forBoundsChange:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicollectionviewlayout/shouldinvalidatelayout(forboundschange:)"
---

# shouldInvalidateLayout(forBoundsChange:)

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

## Declaration

```swift
func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool
```

## Parameters

- `newBounds`: The new bounds of the collection view.

## Return Value

Return Value true if the collection view requires a layout update or false if the layout does not need to change.

## Discussion

Discussion The default implementation of this method returns false. 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 true, the collection view invalidates the layout by calling the invalidateLayout(with:) method.

## See Also

### Invalidating the layout

- [invalidateLayout()](uikit/uicollectionviewlayout/invalidatelayout().md)
- [invalidateLayout(with:)](uikit/uicollectionviewlayout/invalidatelayout(with:).md)
- [invalidationContextClass](uikit/uicollectionviewlayout/invalidationcontextclass.md)
- [invalidationContext(forBoundsChange:)](uikit/uicollectionviewlayout/invalidationcontext(forboundschange:).md)
- [shouldInvalidateLayout(forPreferredLayoutAttributes:withOriginalAttributes:)](uikit/uicollectionviewlayout/shouldinvalidatelayout(forpreferredlayoutattributes:withoriginalattributes:).md)
- [invalidationContext(forPreferredLayoutAttributes:withOriginalAttributes:)](uikit/uicollectionviewlayout/invalidationcontext(forpreferredlayoutattributes:withoriginalattributes:).md)
- [invalidationContext(forInteractivelyMovingItems:withTargetPosition:previousIndexPaths:previousPosition:)](uikit/uicollectionviewlayout/invalidationcontext(forinteractivelymovingitems:withtargetposition:previousindexpaths:previousposition:).md)
- [invalidationContextForEndingInteractiveMovementOfItems(toFinalIndexPaths:previousIndexPaths:movementCancelled:)](uikit/uicollectionviewlayout/invalidationcontextforendinginteractivemovementofitems(tofinalindexpaths:previousindexpaths:movementcancelled:).md)
