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.

Responding to the Menu's Appearance

- contextMenuInteractionWillPresent:

Tells your delegate that the context menu interaction object is preparing to display the preview interface.

Deprecated
- contextMenuInteractionDidEnd:

Tells your delegate that the context menu interaction object dismissed the preview interface and concluded the interaction.

Deprecated
- contextMenuInteraction:willCommitWithAnimator:

Asks your delegate object to provide any custom animations to run when the user taps the preview interface.

Deprecated
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.

Beta
UITargetedPreview

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

Beta
UIPreviewTarget

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

Beta
UIPreviewParameters

Additional parameters to use when animating a preview interface.

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software