---
title: selectedIndex
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avcaptureindexpicker/selectedindex
---

# selectedIndex

The currently selected index.

## Declaration

```swift
var selectedIndex: Int { get set }
```

## Discussion

Discussion The default value is 0. You can only set a value that’s greater than or equal to 0 and less than numberOfIndexes. important: Only modify the selected index from the same dispatch queue that you specified in the control’s setActionQueue:action: method.

## See Also

### Accessing the control value

- [numberOfIndexes](avfoundation/avcaptureindexpicker/numberofindexes.md)
