Generic Instance Method

contextMenu(_:)

Attaches a ContextMenu and its children to self.

Declaration

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

Discussion

This modifier allows for the contextual menu to be conditionally available by passing nil as the value for contextMenu.

See Also

Configuring Context Menu Views