<!--
{
  "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/UIMenuBuilder",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIMenuBuilder"
  },
  "title" : "UIMenuBuilder"
}
-->

# UIMenuBuilder

An interface for adding and removing menus from a menu system.

```
@MainActor protocol UIMenuBuilder
```

## Overview

You don’t create a menu builder object. Instead, you override [`buildMenu(with:)`](/documentation/UIKit/UIResponder/buildMenu(with:)) in your app delegate or view controller to receive a builder object. Where you override this method determines the system that the builder updates. To add and remove menus 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 menu using the [`context`](/documentation/UIKit/UIMenuSystem/context) system, override the method in your view controller.

To see an example of how to use a menu builder object, see [Adding menus and shortcuts to the menu bar and user interface](/documentation/UIKit/adding-menus-and-shortcuts-to-the-menu-bar-and-user-interface).

## Topics

### Getting menu systems and elements

[`system`](/documentation/UIKit/UIMenuBuilder/system)

The menu system that the menu builder modifies.

[`menu(for:)`](/documentation/UIKit/UIMenuBuilder/menu(for:))

Gets the menu for the specified menu identifier.

[`action(for:)`](/documentation/UIKit/UIMenuBuilder/action(for:))

Gets the action for the specified action identifier.

[`command(for:propertyList:)`](/documentation/UIKit/UIMenuBuilder/command(for:propertyList:))

Gets the command for the specified selector and property list.

[`commandForAction:propertyList:`](/documentation/UIKit/UIMenuBuilder/commandForAction:propertyList:)

Gets the command for the specified selector and property list.

### Inserting child menus

[`insertChild(_:atStartOfMenu:)`](/documentation/UIKit/UIMenuBuilder/insertChild(_:atStartOfMenu:))

Adds a child menu as the first element of the specified parent menu.

[`insertChild(_:atEndOfMenu:)`](/documentation/UIKit/UIMenuBuilder/insertChild(_:atEndOfMenu:))

Adds a child menu as the last element of the specified parent menu.

### Inserting sibling menus

[`insertSibling(_:beforeMenu:)`](/documentation/UIKit/UIMenuBuilder/insertSibling(_:beforeMenu:))

Inserts a sibling menu before the specified menu.

[`insertSibling(_:afterMenu:)`](/documentation/UIKit/UIMenuBuilder/insertSibling(_:afterMenu:))

Inserts a sibling menu after the specified menu.

### Replacing menus and child menu elements

[`replaceChildren(ofMenu:from:)`](/documentation/UIKit/UIMenuBuilder/replaceChildren(ofMenu:from:))

Replaces the elements in a menu with the elements returned by the specified handler block.

### Removing a menu

[`remove(menu:)`](/documentation/UIKit/UIMenuBuilder/remove(menu:))

Removes a menu from the menu system.



---

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)