---
title: "shouldInvalidateLayoutForChange(fromVisibleRect:toVisibleRect:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsscrubberlayout/shouldinvalidatelayoutforchange(fromvisiblerect:tovisiblerect:)"
---

# shouldInvalidateLayoutForChange(fromVisibleRect:toVisibleRect:)

Determines whether the scrubber should refresh its layout in response to a change of its visible region.

## Declaration

```swift
func shouldInvalidateLayoutForChange(fromVisibleRect: NSRect, toVisibleRect: NSRect) -> Bool
```

## Discussion

Discussion If true, the scrubber invalidates its layout in response to a change of the visible region, in response to a user scroll action, or to the scrubber being resized. Subclasses that rely on the size or origin of the visible region should return true. The base implementation of this method returns false.

## See Also

### Subclassing a scrubber layout

- [prepare()](appkit/nsscrubberlayout/prepare().md)
- [scrubberContentSize](appkit/nsscrubberlayout/scrubbercontentsize.md)
- [layoutAttributesForItem(at:)](appkit/nsscrubberlayout/layoutattributesforitem(at:).md)
- [layoutAttributesForItems(in:)](appkit/nsscrubberlayout/layoutattributesforitems(in:).md)
- [shouldInvalidateLayoutForSelectionChange](appkit/nsscrubberlayout/shouldinvalidatelayoutforselectionchange.md)
- [shouldInvalidateLayoutForHighlightChange](appkit/nsscrubberlayout/shouldinvalidatelayoutforhighlightchange.md)
- [automaticallyMirrorsInRightToLeftLayout](appkit/nsscrubberlayout/automaticallymirrorsinrighttoleftlayout.md)
