Link Search Menu Expand Document

ContextMenuInteraction

An interaction object that you use to display relevant actions for your content.

public class ContextMenuInteraction: Interaction 

Inheritance

Interaction

Initializers

init(delegate:)

Creates a context menu interaction object with the specified delegate object.

public init(delegate: ContextMenuInteractionDelegate) 

Properties

delegate

The object that provides the preview and contextual menu for your content and responds to interaction-related events.

public private(set) weak var delegate: ContextMenuInteractionDelegate?

view

public private(set) weak var view: View?

appearance

The appearance of the context menu.

public var appearance: ContextMenuInteraction.Appearance = .compact

Methods

willMove(to:)

public func willMove(to view: View?) 

didMove(to:)

public func didMove(to view: View?) 

location(in:)

Returns the location of the user interaction in the specified view’s coordinate system.

public func location(in view: View?) -> Point 

dismissMenu()

Dismisses the context menu.

public func dismissMenu() 

updateVisibleMenu(_:)

Updates the currently visible menu.

public func updateVisibleMenu(_ block: (Menu) -> Menu)