Class

UIMenuElement

An object representing a menu, action, or command.

Declaration

class UIMenuElement : NSObject

Overview

UIMenuElement defines the behavior shared by all menus, actions, and commands. You do not create UIMenuElement objects directly. Instead, you create an appropriate object that inherits from this class, such as UIMenu, UIAction, or UICommand.

Topics

Getting the Element Attributes

var title: String

The title of the menu element.

var image: UIImage?

The image to display alongside the menu element's title.

Creating a Menu Element

Structures

struct UIMenuElement.Attributes

Attributes that determine the style of the menu element.

Enumerations

enum UIMenuElement.State

Constants that indicate the state of an action- or command-based menu element.

Relationships

Inherits From

See Also

Menu Elements and Keyboard Shortcuts

Adding Menus and Shortcuts to the Menu Bar and User Interface

Provide quick access to useful actions by adding menus and keyboard shortcuts to your Mac Catalyst app.

class UIAction

A menu element that performs its action in a closure.

class UICommand

A menu element that performs its action in a selector.

class UIKeyCommand

An object that specifies a key press performed on a hardware keyboard and the resulting action.

struct UIMenuElement.Attributes

Attributes that determine the style of the menu element.

enum UIMenuElement.State

Constants that indicate the state of an action- or command-based menu element.