A container for grouping related menu elements in an app menu or contextual menu.
- iOS 13.0+
- Mac Catalyst 13.0+
- tvOS 13.0+
UIMenu objects and use them to construct the menus and submenus your app displays. You provide menus for your app when it runs on macOS, and key command elements in those menus also appear in the discoverability HUD on iPad when the user presses the command key. You also use menus to display contextual actions in response to specific interactions with one of your views. Every menu has a title, an optional image, and an optional set of child elements. When the user selects an element from the menu, the system executes the code that you provide.
To see examples of how to use
UIMenu, see Adding Menus and Shortcuts to the Menu Bar and User Interface.