Trait UIContextMenuInteractionDelegate

Source
pub unsafe trait UIContextMenuInteractionDelegate: NSObjectProtocol + MainThreadOnly {
    // Provided methods
    unsafe fn contextMenuInteraction_configurationForMenuAtLocation(
        &self,
        interaction: &UIContextMenuInteraction,
        location: CGPoint,
    ) -> Option<Retained<UIContextMenuConfiguration>>
       where Self: Sized + Message { ... }
    unsafe fn contextMenuInteraction_configuration_highlightPreviewForItemWithIdentifier(
        &self,
        interaction: &UIContextMenuInteraction,
        configuration: &UIContextMenuConfiguration,
        identifier: &ProtocolObject<dyn NSCopying>,
    ) -> Option<Retained<UITargetedPreview>>
       where Self: Sized + Message { ... }
    unsafe fn contextMenuInteraction_configuration_dismissalPreviewForItemWithIdentifier(
        &self,
        interaction: &UIContextMenuInteraction,
        configuration: &UIContextMenuConfiguration,
        identifier: &ProtocolObject<dyn NSCopying>,
    ) -> Option<Retained<UITargetedPreview>>
       where Self: Sized + Message { ... }
    unsafe fn contextMenuInteraction_willPerformPreviewActionForMenuWithConfiguration_animator(
        &self,
        interaction: &UIContextMenuInteraction,
        configuration: &UIContextMenuConfiguration,
        animator: &ProtocolObject<dyn UIContextMenuInteractionCommitAnimating>,
    )
       where Self: Sized + Message { ... }
    unsafe fn contextMenuInteraction_willDisplayMenuForConfiguration_animator(
        &self,
        interaction: &UIContextMenuInteraction,
        configuration: &UIContextMenuConfiguration,
        animator: Option<&ProtocolObject<dyn UIContextMenuInteractionAnimating>>,
    )
       where Self: Sized + Message { ... }
    unsafe fn contextMenuInteraction_willEndForConfiguration_animator(
        &self,
        interaction: &UIContextMenuInteraction,
        configuration: &UIContextMenuConfiguration,
        animator: Option<&ProtocolObject<dyn UIContextMenuInteractionAnimating>>,
    )
       where Self: Sized + Message { ... }
    unsafe fn contextMenuInteraction_previewForHighlightingMenuWithConfiguration(
        &self,
        interaction: &UIContextMenuInteraction,
        configuration: &UIContextMenuConfiguration,
    ) -> Option<Retained<UITargetedPreview>>
       where Self: Sized + Message { ... }
    unsafe fn contextMenuInteraction_previewForDismissingMenuWithConfiguration(
        &self,
        interaction: &UIContextMenuInteraction,
        configuration: &UIContextMenuConfiguration,
    ) -> Option<Retained<UITargetedPreview>>
       where Self: Sized + Message { ... }
}
Available on crate feature UIContextMenuInteraction only.
Expand description

Provided Methods§

Source

unsafe fn contextMenuInteraction_configurationForMenuAtLocation( &self, interaction: &UIContextMenuInteraction, location: CGPoint, ) -> Option<Retained<UIContextMenuConfiguration>>
where Self: Sized + Message,

Available on crate features UIContextMenuConfiguration and objc2-core-foundation only.

Called when the interaction begins.

Parameter interaction: The UIContextMenuInteraction.

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

Source

unsafe fn contextMenuInteraction_configuration_highlightPreviewForItemWithIdentifier( &self, interaction: &UIContextMenuInteraction, configuration: &UIContextMenuConfiguration, identifier: &ProtocolObject<dyn NSCopying>, ) -> Option<Retained<UITargetedPreview>>
where Self: Sized + Message,

Available on crate features UIContextMenuConfiguration and UITargetedPreview only.

Called when a context menu interaction begins. Return a UITargetedPreview corresponding to the item with the given identifier.

Parameter interaction: The UIContextMenuInteraction.

Parameter configuration: Configuration of the menu that will be presented if the interaction proceeds.

Parameter identifier: Identifier for the item whose preview is being requested.

Source

unsafe fn contextMenuInteraction_configuration_dismissalPreviewForItemWithIdentifier( &self, interaction: &UIContextMenuInteraction, configuration: &UIContextMenuConfiguration, identifier: &ProtocolObject<dyn NSCopying>, ) -> Option<Retained<UITargetedPreview>>
where Self: Sized + Message,

Available on crate features UIContextMenuConfiguration and UITargetedPreview only.

Called when a context menu is dismissed. Return a UITargetedPreview corresponding to the item with the given identifier.

Parameter interaction: The UIContextMenuInteraction.

Parameter configuration: Configuration of the menu being dismissed.

Parameter identifier: Identifier for the item whose preview is being requested.

Source

unsafe fn contextMenuInteraction_willPerformPreviewActionForMenuWithConfiguration_animator( &self, interaction: &UIContextMenuInteraction, configuration: &UIContextMenuConfiguration, animator: &ProtocolObject<dyn UIContextMenuInteractionCommitAnimating>, )
where Self: Sized + Message,

Available on crate feature UIContextMenuConfiguration only.

Called when the interaction is about to “commit” in response to the user tapping the preview.

Parameter interaction: The UIContextMenuInteraction.

Parameter configuration: Configuration of the currently displayed menu.

Parameter animator: Commit animator. Add animations to this object to run them alongside the commit transition.

Source

unsafe fn contextMenuInteraction_willDisplayMenuForConfiguration_animator( &self, interaction: &UIContextMenuInteraction, configuration: &UIContextMenuConfiguration, animator: Option<&ProtocolObject<dyn UIContextMenuInteractionAnimating>>, )
where Self: Sized + Message,

Available on crate feature UIContextMenuConfiguration only.

Called when the interaction is about to display a menu.

Parameter interaction: The UIContextMenuInteraction.

Parameter configuration: The configuration of the menu about to be displayed by this interaction.

Parameter animator: Appearance animator. Add animations to run them alongside the appearance transition.

Source

unsafe fn contextMenuInteraction_willEndForConfiguration_animator( &self, interaction: &UIContextMenuInteraction, configuration: &UIContextMenuConfiguration, animator: Option<&ProtocolObject<dyn UIContextMenuInteractionAnimating>>, )
where Self: Sized + Message,

Available on crate feature UIContextMenuConfiguration only.

Called when the interaction is about to end.

Parameter interaction: The UIContextMenuInteraction.

Parameter configuration: Ending configuration.

Parameter animator: Disappearance animator. Add animations to run them alongside the disappearance transition.

Source

unsafe fn contextMenuInteraction_previewForHighlightingMenuWithConfiguration( &self, interaction: &UIContextMenuInteraction, configuration: &UIContextMenuConfiguration, ) -> Option<Retained<UITargetedPreview>>
where Self: Sized + Message,

👎Deprecated
Available on crate features UIContextMenuConfiguration and UITargetedPreview only.

Called when the interaction begins. Return a UITargetedPreview describing the desired highlight preview.

Parameter interaction: The UIContextMenuInteraction requesting a highlighting preview.

Parameter configuration: The configuration of the menu about to be displayed by this interaction.

Source

unsafe fn contextMenuInteraction_previewForDismissingMenuWithConfiguration( &self, interaction: &UIContextMenuInteraction, configuration: &UIContextMenuConfiguration, ) -> Option<Retained<UITargetedPreview>>
where Self: Sized + Message,

👎Deprecated
Available on crate features UIContextMenuConfiguration and UITargetedPreview only.

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.

Parameter interaction: The UIContextMenuInteraction requesting a dismissal preview.

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

Trait Implementations§

Source§

impl ProtocolType for dyn UIContextMenuInteractionDelegate

Source§

const NAME: &'static str = "UIContextMenuInteractionDelegate"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn UIContextMenuInteractionDelegate

Implementations on Foreign Types§

Source§

impl<T> UIContextMenuInteractionDelegate for ProtocolObject<T>

Implementors§

Source§

impl UIContextMenuInteractionDelegate for UIControl

Available on crate feature UIControl only.