---
title: indexOfSelectedItem
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nspopupbutton/indexofselecteditem
---

# indexOfSelectedItem

The index of the item that was last selected by the user.

## Declaration

```swift
var indexOfSelectedItem: Int { get }
```

## Discussion

Discussion If no item is selected, the value in this property is -1.

## See Also

### Getting the user’s selection

- [selectedItem](appkit/nspopupbutton/selecteditem.md)
- [titleOfSelectedItem](appkit/nspopupbutton/titleofselecteditem.md)
