---
title: "addItem(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsmenu/additem(_:)"
---

# addItem(_:)

Adds a menu item to the end of the menu.

## Declaration

```swift
func addItem(_ newItem: NSMenuItem)
```

## Parameters

- `newItem`: The menu item (an object conforming to the NSMenuItem protocol) to add to the menu.

## Discussion

Discussion This method invokes insertItem(_:at:). Thus, the menu does not accept the menu item if it already belongs to another menu. After adding the menu item, the menu updates itself.

## See Also

### Adding and Removing Menu Items

- [insertItem(_:at:)](appkit/nsmenu/insertitem(_:at:).md)
- [insertItem(withTitle:action:keyEquivalent:at:)](appkit/nsmenu/insertitem(withtitle:action:keyequivalent:at:).md)
- [addItem(withTitle:action:keyEquivalent:)](appkit/nsmenu/additem(withtitle:action:keyequivalent:).md)
- [removeItem(_:)](appkit/nsmenu/removeitem(_:).md)
- [removeItem(at:)](appkit/nsmenu/removeitem(at:).md)
- [itemChanged(_:)](appkit/nsmenu/itemchanged(_:).md)
- [removeAllItems()](appkit/nsmenu/removeallitems().md)
