Instance Method

addMenuItemWithImageNamed:title:action:

Adds an action to the context menu using an existing image resource in your Watch app bundle.

Declaration

- (void)addMenuItemWithImageNamed:(NSString *)imageName title:(NSString *)title action:(SEL)action;

Parameters

imageName

The name of the image to be loaded from your Watch app’s bundle. Include the filename extension in the name. This parameter must not be nil.

title

The title string to be displayed underneath the image. Title strings should be reasonably short. Any text that cannot be displayed is truncated. This parameter must not be nil or an empty string.

action

The action method to be called when the action is tapped. The method must be defined on the current interface controller object. This parameter must not be nil.

Discussion

Use this method to append an action to the interface controller’s context menu. If the menu already has four items, additional items are ignored.

See Also

Configuring the Context Menu

- addMenuItemWithItemIcon:title:action:

Adds an action to the context menu using a system-provided icon.

- addMenuItemWithImage:title:action:

Adds an action to the context menu by using an image provided by your WatchKit extension.

- clearAllMenuItems

Removes all programmatically added actions from the context menu.

WKMenuItemIcon

Template images that you can use for menus.