---
title: "isSelected(at:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstoolbaritemgroup/isselected(at:)"
---

# isSelected(at:)

Indicates whether a specified index is currently selected.

## Declaration

```swift
func isSelected(at index: Int) -> Bool
```

## Parameters

- `index`: The index of the subitems in a grouped toolbar item.

## Return Value

Return Value A Boolean value indicating whether the specified index is currently selected.

## Discussion

Discussion Use this method when you specify the NSToolbarItemGroup.SelectionMode.selectAny selection mode for the grouped toolbar item to determine which subitems are currently selected.

## See Also

### Working with subitems

- [subitems](appkit/nstoolbaritemgroup/subitems.md)
- [selectedIndex](appkit/nstoolbaritemgroup/selectedindex.md)
- [setSelected(_:at:)](appkit/nstoolbaritemgroup/setselected(_:at:).md)
