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