UIContextMenuInteractionDelegate
The methods for providing the set of actions to perform on your content, and for customizing the preview of that content.
Declaration
@MainActor protocol UIContextMenuInteractionDelegate : NSObjectProtocolMentioned in
Overview
Use this protocol to provide UIKit with the contextual menu that you want to display. When a UIContextMenuInteraction object detects an appropriate interaction, it calls the contextMenuInteraction(_:configurationForMenuAtLocation:) method of your delegate. You use that method to specify the basic configuration details for your interface. In addition to your contextual menu, you can tell UIKit whether you want it to display a default preview interface or a custom view controller that you provide. You can also specify options for how you want UIKit to animate the presentation and dismissal of that interface.
For additional information about how to implement contextual menus, see Adding context menus in your app.
Topics
Providing the preview configuration data
Customizing the preview animations
contextMenuInteraction(_:configuration:highlightPreviewForItemWithIdentifier:)contextMenuInteraction(_:configuration:dismissalPreviewForItemWithIdentifier:)Adding menus and shortcuts to the menu bar and user interface
Responding to the menu’s appearance
contextMenuInteraction(_:willPerformPreviewActionForMenuWith:animator:)UIContextMenuInteractionCommitAnimating
Handling animations
contextMenuInteraction(_:willDisplayMenuFor:animator:)contextMenuInteraction(_:willEndFor:animator:)UIContextMenuInteractionAnimating