---
title: "scrubber(_:didSelectItemAt:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsscrubberdelegate/scrubber(_:didselectitemat:)"
---

# scrubber(_:didSelectItemAt:)

Tells the delegate that the item at the specified index was selected.

## Declaration

```swift
@MainActor optional func scrubber(_ scrubber: NSScrubber, didSelectItemAt selectedIndex: Int)
```

## Parameters

- `scrubber`: The scrubber object that is notifying you of the selection change.
- `selectedIndex`: The index of the item that was selected.

## See Also

### Handling item selection and highlighting

- [scrubber(_:didHighlightItemAt:)](appkit/nsscrubberdelegate/scrubber(_:didhighlightitemat:).md)
