<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIResponder/buildMenu(with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIResponder(im)buildMenuWithBuilder:"
  },
  "title" : "buildMenu(with:)"
}
-->

# buildMenu(with:)

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

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

## Parameters

`builder`

An object that you use to modify a menu system for your app.

## Discussion

Override this method in your app delegate or view controller to receive a [`UIMenuBuilder`](/documentation/UIKit/UIMenuBuilder) object. Use the builder to add and remove [`UIMenuElement`](/documentation/UIKit/UIMenuElement) objects such as [`UIMenu`](/documentation/UIKit/UIMenu), [`UIAction`](/documentation/UIKit/UIAction), and [`UICommand`](/documentation/UIKit/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`](/documentation/UIKit/UIMenuSystem/main) menu system, override [`buildMenu(with:)`](/documentation/UIKit/UIResponder/buildMenu(with:)) in your app delegate. To build a [`context`](/documentation/UIKit/UIMenuSystem/context) menu using the context system, override this method in your view controller.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)