<!--
{
  "availability" : [
    "macOS: 10.12.2 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSScrubberLayout",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSScrubberLayout"
  },
  "title" : "NSScrubberLayout"
}
-->

# NSScrubberLayout

An abstract class that describes the layout of items within a scrubber control.

```
@MainActor class NSScrubberLayout
```

## Overview

To determine the layout of items in a scrubber, use one of the built-in subclasses ([`NSScrubberProportionalLayout`](/documentation/AppKit/NSScrubberProportionalLayout) or [`NSScrubberFlowLayout`](/documentation/AppKit/NSScrubberFlowLayout)), or create a custom subclass to implement your own layout.

## Topics

### Creating a scrubber layout

[`init()`](/documentation/AppKit/NSScrubberLayout/init())

Initializes and returns a newly allocated scrubber layout object from code.

[`init(coder:)`](/documentation/AppKit/NSScrubberLayout/init(coder:))

Initializes and returns a newly allocated scrubber layout object from a storyboard or nib file.

### Configuring a scrubber layout

[`layoutAttributesClass`](/documentation/AppKit/NSScrubberLayout/layoutAttributesClass)

A property containing a class that describes layout attributes.

[`scrubber`](/documentation/AppKit/NSScrubberLayout/scrubber)

The scrubber control that this layout is assigned to.

[`visibleRect`](/documentation/AppKit/NSScrubberLayout/visibleRect)

The currently visible rectangle, in the coordinate space of the scrubber content.

[`invalidateLayout()`](/documentation/AppKit/NSScrubberLayout/invalidateLayout())

Signals that the layout has been invalidated, and that the scrubber control should perform a new layout pass.

### Subclassing a scrubber layout

[`prepare()`](/documentation/AppKit/NSScrubberLayout/prepare())

Gives you an opportunity to perform layout calculations when the scrubber’s layout is invalidated.

[`scrubberContentSize`](/documentation/AppKit/NSScrubberLayout/scrubberContentSize)

The size required to contain all elements within the scrubber.

[`layoutAttributesForItem(at:)`](/documentation/AppKit/NSScrubberLayout/layoutAttributesForItem(at:))

The layout attributes for the item with the specified index.

[`layoutAttributesForItems(in:)`](/documentation/AppKit/NSScrubberLayout/layoutAttributesForItems(in:))

The set of layout attributes for all items within the provided rectangle.

[`shouldInvalidateLayoutForSelectionChange`](/documentation/AppKit/NSScrubberLayout/shouldInvalidateLayoutForSelectionChange)

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

[`shouldInvalidateLayoutForHighlightChange`](/documentation/AppKit/NSScrubberLayout/shouldInvalidateLayoutForHighlightChange)

Determines whether the scrubber should refresh its layout when an item is highlighted.

[`shouldInvalidateLayoutForChange(fromVisibleRect:toVisibleRect:)`](/documentation/AppKit/NSScrubberLayout/shouldInvalidateLayoutForChange(fromVisibleRect:toVisibleRect:))

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

[`automaticallyMirrorsInRightToLeftLayout`](/documentation/AppKit/NSScrubberLayout/automaticallyMirrorsInRightToLeftLayout)

Determines whether the scrubber mirrors its layout for right-to-left layouts.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)