Contents

UIContextMenuConfiguration

An object containing the configuration details for the contextual menu.

Declaration

@MainActor class UIContextMenuConfiguration

Overview

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.

Topics

Creating the menu configuration object

Getting the configuration identifier

Handling multiple-item interactions

Specifying the order of menu elements

See Also

Providing the preview configuration data