Contents

buildMenu(with:)

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

Declaration

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 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.

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