An object containing the configuration details for the contextual menu.


class UIContextMenuConfiguration : NSObject


Before displaying a contextual menu, the system asks your UIContextMenuInteractionDelegate to provide a UIContextMenuConfiguration object with details about that menu. In your contextMenuInteraction(_:configurationForMenuAtLocation:) method, use the location parameter to determine where the interaction occurred, and use the content at that location to configure your contextual menu and view controller. Provide custom blocks to generate:

  • The contextual menu with the actions for your content.

  • An optional view controller to use when displaying your content.

If you specify a default object without any custom handler blocks, the system displays a default preview interface with no menu.


Creating the Menu Configuration Object

typealias UIContextMenuContentPreviewProvider

Returns the custom view controller to use when previewing your content.

typealias UIContextMenuActionProvider

Returns an action-based contextual menu, optionally incorporating the system-suggested actions.

Getting the Configuration Identifier

var identifier: NSCopying

The unique identifier for this configuration object.


Inherits From

Conforms To

See Also

Providing the Preview Configuration Data

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