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