---
title: "buildMenu(with:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiresponder/buildmenu(with:)"
---

# buildMenu(with:)

Asks the receiving responder to add and remove items from a menu system.

## Declaration

```swift
func buildMenu(with builder: any UIMenuBuilder)
```

## Parameters

- `builder`: An object that you use to modify a menu system for your app.

## Discussion

Discussion Override this method in your app delegate or view controller to receive a UIMenuBuilder object. Use the builder to add and remove UIMenuElement objects such as UIMenu, UIAction, and UICommand from your app’s menu bar or context menus. note: The menu bar is available in Mac apps built with Mac Catalyst. Where you override this method determines the menu system that the builder updates. To add and remove items from the menu bar using the main menu system, override buildMenu(with:) in your app delegate. To build a context menu using the context system, override this method in your view controller.

## See Also

### Building and validating commands

- [validate(_:)](uikit/uiresponder/validate(_:).md)
- [canPerformAction(_:withSender:)](uikit/uiresponder/canperformaction(_:withsender:).md)
- [target(forAction:withSender:)](uikit/uiresponder/target(foraction:withsender:).md)
