Generic Instance Method

contextMenu(_:)

Attaches a contextual menu and its children to the view.

Declaration

func contextMenu<MenuItems>(_ contextMenu: ContextMenu<MenuItems>?) -> some View where MenuItems : View

Discussion

Use this modifier to make the contextual menu conditionally available by passing nil as the value for contextMenu.

See Also

Configuring Context Menu Views

struct ContextMenu

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