Generic Structure


A container for views that you present as a menu items in a contextual menu in response to the standard system gesture.


struct ContextMenu<MenuItems> where MenuItems : View


Make sure the controls contained in a context menu are related to the context from which you show them.


Creating a Context Menu

See Also

Configuring Context Menu Views

func contextMenu<MenuItems>(ContextMenu<MenuItems>?) -> View

Attaches a contextual menu and its children to the view.

func contextMenu<MenuItems>(menuItems: () -> MenuItems) -> View

Attaches a contextual menu to the view.


Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software