---
title: shouldInvalidateLayoutForSelectionChange
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsscrubberlayout/shouldinvalidatelayoutforselectionchange
---

# shouldInvalidateLayoutForSelectionChange

Determines whether the scrubber should refresh its layout when the selection changes.

## Declaration

```swift
var shouldInvalidateLayoutForSelectionChange: Bool { get }
```

## Discussion

Discussion If true, the scrubber invalidates its layout when the selection changes. Subclasses should return true if the selection index affects the item layout. The base implementation 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)
- [shouldInvalidateLayoutForHighlightChange](appkit/nsscrubberlayout/shouldinvalidatelayoutforhighlightchange.md)
- [shouldInvalidateLayoutForChange(fromVisibleRect:toVisibleRect:)](appkit/nsscrubberlayout/shouldinvalidatelayoutforchange(fromvisiblerect:tovisiblerect:).md)
- [automaticallyMirrorsInRightToLeftLayout](appkit/nsscrubberlayout/automaticallymirrorsinrighttoleftlayout.md)
