---
title: indexPathsForSelectedItems
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uicollectionview/indexpathsforselecteditems
---

# indexPathsForSelectedItems

The index paths for the selected items.

## Declaration

```swift
var indexPathsForSelectedItems: [IndexPath]? { get }
```

## Discussion

Discussion The value of this property is an array of NSIndexPath objects, each of which corresponds to a single selected item. If there are no selected items, the value of this property is nil.

## See Also

### Selecting cells

- [selectItem(at:animated:scrollPosition:)](uikit/uicollectionview/selectitem(at:animated:scrollposition:).md)
- [deselectItem(at:animated:)](uikit/uicollectionview/deselectitem(at:animated:).md)
- [allowsSelection](uikit/uicollectionview/allowsselection.md)
- [allowsMultipleSelection](uikit/uicollectionview/allowsmultipleselection.md)
- [allowsSelectionDuringEditing](uikit/uicollectionview/allowsselectionduringediting.md)
- [allowsMultipleSelectionDuringEditing](uikit/uicollectionview/allowsmultipleselectionduringediting.md)
- [selectionFollowsFocus](uikit/uicollectionview/selectionfollowsfocus.md)
