Protocol

UIContextMenuInteractionDelegate

The methods for providing the set of actions to perform on your content, and for customizing the preview of that content.

Declaration

@protocol UIContextMenuInteractionDelegate

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.

Topics

Providing the Preview Configuration Data

- contextMenuInteraction:configurationForMenuAtLocation:

Returns the configuration data to use when previewing the content.

Required.

UIContextMenuConfiguration

An object containing the configuration details for the contextual menu.

Customizing the Preview Animations

- contextMenuInteraction:previewForHighlightingMenuWithConfiguration:

Returns the source view to use when animating the appearance of the preview interface.

- contextMenuInteraction:previewForDismissingMenuWithConfiguration:

Returns the destination view to use when animating the appearance of the preview interface.

Adding Menus and Shortcuts to the Menu Bar and User Interface

Provide quick access to useful actions by adding menus and keyboard shortcuts to your Mac Catalyst app.

Responding to the Menu's Appearance

UIContextMenuInteractionCommitAnimating

Methods adopted by system-supplied animator objects when committing preview-related animations.

Relationships

Inherits From

See Also

Contextual Menus

UIContextMenuInteraction

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

UITargetedPreview

An object describing the view to use during preview-related animations.

UIPreviewTarget

An object that specifies the container view to use for animations.

UIPreviewParameters

Additional parameters to use when animating a preview interface.