---
title: selectedItem
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nspopupbutton/selecteditem
---

# selectedItem

The menu item that was last selected by the user.

## Declaration

```swift
var selectedItem: NSMenuItem? { get }
```

## Discussion

Discussion The last selected menu item is the one that was highlighted when the user released the mouse button. It is possible for a pull-down menu’s selected item to be its first item. If no item is selected, the value in this property is nil.

## See Also

### Getting the user’s selection

- [titleOfSelectedItem](appkit/nspopupbutton/titleofselecteditem.md)
- [indexOfSelectedItem](appkit/nspopupbutton/indexofselecteditem.md)
