Protocol

UIMenuBuilder

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

Declaration

@protocol UIMenuBuilder

Overview

You don't create a menu builder object. Instead, you override buildMenuWithBuilder: 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 mainSystem menu system, override buildMenuWithBuilder: in your app delegate. To build a context menu using the contextSystem 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.

Topics

Getting Menu Systems and Elements

system

The menu system that the menu builder modifies.

Required.

- menuForIdentifier:

Gets the menu for the specified menu identifier.

Required.

- actionForIdentifier:

Gets the action for the specified action identifier.

Required.

- commandForAction:propertyList:

Gets the command for the specified selector and property list.

Required.

Inserting Child Menus

- insertChildMenu:atStartOfMenuForIdentifier:

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

Required.

- insertChildMenu:atEndOfMenuForIdentifier:

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

Required.

Inserting Sibling Menus

- insertSiblingMenu:beforeMenuForIdentifier:

Inserts a sibling menu before the specified menu.

Required.

- insertSiblingMenu:afterMenuForIdentifier:

Inserts a sibling menu after the specified menu.

Required.

Replacing Menus and Child Menu Elements

- replaceMenuForIdentifier:withMenu:

Replaces the specified menu with a new menu.

Required.

- replaceChildrenOfMenuForIdentifier:fromChildrenBlock:

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

Required.

Removing a Menu

- removeMenuForIdentifier:

Removes a menu from the menu system.

Required.

See Also

App Menus

UIMenu

A container for grouping related menu elements in an app menu or contextual menu.

UIMenuSystem

An object representing a main or contextual menu system.