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

# selectionIndexPaths

The set of index paths representing the currently selected items.

```
var selectionIndexPaths: Set<IndexPath> { get set }
```

## Discussion

This property reflects the index paths of the currently selected items, where each index path contains a <doc://com.apple.documentation/documentation/Foundation/NSIndexPath/section> number and an index number for the <doc://com.apple.documentation/documentation/Foundation/NSIndexPath/item> in that section. This property is updated automatically when the user selects items interactively. You can also change the selection programmatically by assigning a new value to this property. To animate changes to the selection, call this method on the collection view’s [`animator()`](/documentation/AppKit/NSAnimatablePropertyContainer/animator()) proxy object instead.

It is a programmer error to specify an index path that does not refer to a valid item in the data source. If you specify an invalid index path, this method raises an exception.

This property is key-value observable. Other methods that modify the selection automatically update this property.

---

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)