---
title: selectedIndex
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uitabbarcontroller/selectedindex
---

# selectedIndex

The index of the view controller associated with the currently selected tab item.

## Declaration

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

## Discussion

Discussion This property nominally represents an index into the array of the viewControllers property. However, if the selected view controller is currently the More navigation controller, this property contains the value NSNotFound. Setting this property changes the selected view controller to the one at the designated index in the viewControllers array. To select the More navigation controller itself, you must change the value of the selectedViewController property instead. In versions of iOS prior to version 3.0, this property reflects the index of the selected tab bar item only. Attempting to set this value to an index of a view controller that is not visible in the tab bar, but is instead managed by the More navigation controller, has no effect. note: The More interface is not available in tvOS.

## See Also

### Managing the selected tab

- [selectedTab](uikit/uitabbarcontroller/selectedtab.md)
- [selectedViewController](uikit/uitabbarcontroller/selectedviewcontroller.md)
