<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionView/selectionIndexes",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCollectionView(py)selectionIndexes"
  },
  "title" : "selectionIndexes"
}
-->

# selectionIndexes

The indexes of the currently selected items.

```
var selectionIndexes: IndexSet { get set }
```

## Discussion

Whenever possible, use the [`selectionIndexPaths`](/documentation/AppKit/NSCollectionView/selectionIndexPaths) property instead of this one to set selections.

This property is observable using key-value observing.

---

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)