Interface UIContextMenuInteractionDelegate

    • Method Detail

      • contextMenuInteractionConfigurationForMenuAtLocation

        UIContextMenuConfiguration contextMenuInteractionConfigurationForMenuAtLocation​(UIContextMenuInteraction interaction,
                                                                                        CGPoint location)
        Called when the interaction begins.
        Parameters:
        interaction - The UIContextMenuInteraction.
        location - The location of the interaction in its view.
        Returns:
        A UIContextMenuConfiguration describing the menu to be presented. Return nil to prevent the interaction from beginning. Returning an empty configuration causes the interaction to begin then fail with a cancellation effect. You might use this to indicate to users that it's possible for a menu to be presented from this view, but that there are no actions to present at this particular time.
      • contextMenuInteractionPreviewForDismissingMenuWithConfiguration

        default UITargetedPreview contextMenuInteractionPreviewForDismissingMenuWithConfiguration​(UIContextMenuInteraction interaction,
                                                                                                  UIContextMenuConfiguration configuration)
        Called when the interaction is about to dismiss. Return a UITargetedPreview describing the desired dismissal target. The interaction will animate the presented menu to the target. Use this to customize the dismissal animation.
        Parameters:
        interaction - The UIContextMenuInteraction requesting a dismissal preview.
        configuration - The configuration of the menu displayed by this interaction.
        Returns:
        Return a UITargetedPreview describing the desired dismissal target. Return nil to cause the menu to animate away without morphing into a specific view.
      • contextMenuInteractionPreviewForHighlightingMenuWithConfiguration

        default UITargetedPreview contextMenuInteractionPreviewForHighlightingMenuWithConfiguration​(UIContextMenuInteraction interaction,
                                                                                                    UIContextMenuConfiguration configuration)
        Called when the interaction begins. Return a UITargetedPreview describing the desired highlight preview.
        Parameters:
        interaction - The UIContextMenuInteraction requesting a highlighting preview.
        configuration - The configuration of the menu about to be displayed by this interaction.
      • contextMenuInteractionWillDisplayMenuForConfigurationAnimator

        default void contextMenuInteractionWillDisplayMenuForConfigurationAnimator​(UIContextMenuInteraction interaction,
                                                                                   UIContextMenuConfiguration configuration,
                                                                                   UIContextMenuInteractionAnimating animator)
        Called when the interaction is about to display a menu.
        Parameters:
        interaction - The UIContextMenuInteraction.
        configuration - The configuration of the menu about to be displayed by this interaction.
        animator - Appearance animator. Add animations to run them alongside the appearance transition.
      • contextMenuInteractionWillEndForConfigurationAnimator

        default void contextMenuInteractionWillEndForConfigurationAnimator​(UIContextMenuInteraction interaction,
                                                                           UIContextMenuConfiguration configuration,
                                                                           UIContextMenuInteractionAnimating animator)
        Called when the interaction is about to end.
        Parameters:
        interaction - The UIContextMenuInteraction.
        configuration - Ending configuration.
        animator - Disappearance animator. Add animations to run them alongside the disappearance transition.
      • contextMenuInteractionWillPerformPreviewActionForMenuWithConfigurationAnimator

        default void contextMenuInteractionWillPerformPreviewActionForMenuWithConfigurationAnimator​(UIContextMenuInteraction interaction,
                                                                                                    UIContextMenuConfiguration configuration,
                                                                                                    UIContextMenuInteractionCommitAnimating animator)
        Called when the interaction is about to "commit" in response to the user tapping the preview.
        Parameters:
        interaction - The UIContextMenuInteraction.
        configuration - Configuration of the currently displayed menu.
        animator - Commit animator. Add animations to this object to run them alongside the commit transition.