Generic Instance Method


Attaches a contextual menu and its children to the view.


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


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.