Initializer

init(title:image:identifier:options:children:)

Creates a new menu with the specified values.

Declaration

convenience init(title: String, image: UIImage? = nil, identifier: UIMenu.Identifier? = nil, options: UIMenu.Options = [], children: [UIMenuElement] = [])

Parameters

title

The title of the menu.

image

The image to display next to the menu's title.

identifier

The unique identifier for the menu. When creating standard menus for your app, specify an appropriate constant defined in UIMenu.Identifier. For custom menus, specify a custom reverse domain name value or specify nil to let this method create a unique identifier for you.

options

Additional configuration options for the menu. For a list of possible values, see UIMenu.Options.

children

The menu elements contained in the menu. Specify leaf menu elements using UIAction, UICommand, or UIKeyCommand objects, and specify submenus using UIMenu objects. You may specify an empty array if the menu has no child menu elements.

See Also

Creating a Menu Object

struct UIMenu.Identifier

Constants for identifying an app's standard menus.

struct UIMenu.Options

Options for configuring a menu's appearance.