---
title: "item(withTag:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsmenu/item(withtag:)"
---

# item(withTag:)

Returns the first menu item in the menu with the specified tag.

## Declaration

```swift
func item(withTag tag: Int) -> NSMenuItem?
```

## Parameters

- `tag`: A numeric tag associated with a menu item.

## Return Value

Return Value The found menu item (an object conforming to the NSMenuItem protocol) or nil if the object couldn’t be found.

## See Also

### Related Documentation

- [indexOfItem(withTag:)](appkit/nsmenu/indexofitem(withtag:).md)

### Finding Menu Items

- [item(withTitle:)](appkit/nsmenu/item(withtitle:).md)
- [item(at:)](appkit/nsmenu/item(at:).md)
- [numberOfItems](appkit/nsmenu/numberofitems.md)
- [items](appkit/nsmenu/items.md)
