Generic Structure

ContextMenu

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

Declaration

struct ContextMenu<MenuItems> where MenuItems : View

Overview

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

Topics

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.

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

Attaches a contextual menu to the view.

Beta

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