pub unsafe trait UIContextMenuInteractionDelegate: NSObjectProtocol + MainThreadOnly {
// Provided methods
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 { ... }
fn contextMenuInteraction_willPerformPreviewActionForMenuWithConfiguration_animator(
&self,
interaction: &UIContextMenuInteraction,
configuration: &UIContextMenuConfiguration,
animator: &ProtocolObject<dyn UIContextMenuInteractionCommitAnimating>,
)
where Self: Sized + Message { ... }
fn contextMenuInteraction_willDisplayMenuForConfiguration_animator(
&self,
interaction: &UIContextMenuInteraction,
configuration: &UIContextMenuConfiguration,
animator: Option<&ProtocolObject<dyn UIContextMenuInteractionAnimating>>,
)
where Self: Sized + Message { ... }
fn contextMenuInteraction_willEndForConfiguration_animator(
&self,
interaction: &UIContextMenuInteraction,
configuration: &UIContextMenuConfiguration,
animator: Option<&ProtocolObject<dyn UIContextMenuInteractionAnimating>>,
)
where Self: Sized + Message { ... }
fn contextMenuInteraction_previewForHighlightingMenuWithConfiguration(
&self,
interaction: &UIContextMenuInteraction,
configuration: &UIContextMenuConfiguration,
) -> Option<Retained<UITargetedPreview>>
where Self: Sized + Message { ... }
fn contextMenuInteraction_previewForDismissingMenuWithConfiguration(
&self,
interaction: &UIContextMenuInteraction,
configuration: &UIContextMenuConfiguration,
) -> Option<Retained<UITargetedPreview>>
where Self: Sized + Message { ... }
}UIContextMenuInteraction only.Expand description
Provided Methods§
Sourcefn contextMenuInteraction_configurationForMenuAtLocation(
&self,
interaction: &UIContextMenuInteraction,
location: CGPoint,
) -> Option<Retained<UIContextMenuConfiguration>>
Available on crate features UIContextMenuConfiguration and objc2-core-foundation only.
fn contextMenuInteraction_configurationForMenuAtLocation( &self, interaction: &UIContextMenuInteraction, location: CGPoint, ) -> Option<Retained<UIContextMenuConfiguration>>
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.
Sourceunsafe fn contextMenuInteraction_configuration_highlightPreviewForItemWithIdentifier(
&self,
interaction: &UIContextMenuInteraction,
configuration: &UIContextMenuConfiguration,
identifier: &ProtocolObject<dyn NSCopying>,
) -> Option<Retained<UITargetedPreview>>
Available on crate features UIContextMenuConfiguration and UITargetedPreview only.
unsafe fn contextMenuInteraction_configuration_highlightPreviewForItemWithIdentifier( &self, interaction: &UIContextMenuInteraction, configuration: &UIContextMenuConfiguration, identifier: &ProtocolObject<dyn NSCopying>, ) -> Option<Retained<UITargetedPreview>>
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.
§Safety
identifier should be of the correct type.
Sourceunsafe fn contextMenuInteraction_configuration_dismissalPreviewForItemWithIdentifier(
&self,
interaction: &UIContextMenuInteraction,
configuration: &UIContextMenuConfiguration,
identifier: &ProtocolObject<dyn NSCopying>,
) -> Option<Retained<UITargetedPreview>>
Available on crate features UIContextMenuConfiguration and UITargetedPreview only.
unsafe fn contextMenuInteraction_configuration_dismissalPreviewForItemWithIdentifier( &self, interaction: &UIContextMenuInteraction, configuration: &UIContextMenuConfiguration, identifier: &ProtocolObject<dyn NSCopying>, ) -> Option<Retained<UITargetedPreview>>
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.
§Safety
identifier should be of the correct type.
Sourcefn contextMenuInteraction_willPerformPreviewActionForMenuWithConfiguration_animator(
&self,
interaction: &UIContextMenuInteraction,
configuration: &UIContextMenuConfiguration,
animator: &ProtocolObject<dyn UIContextMenuInteractionCommitAnimating>,
)
Available on crate feature UIContextMenuConfiguration only.
fn contextMenuInteraction_willPerformPreviewActionForMenuWithConfiguration_animator( &self, interaction: &UIContextMenuInteraction, configuration: &UIContextMenuConfiguration, animator: &ProtocolObject<dyn UIContextMenuInteractionCommitAnimating>, )
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.
Sourcefn contextMenuInteraction_willDisplayMenuForConfiguration_animator(
&self,
interaction: &UIContextMenuInteraction,
configuration: &UIContextMenuConfiguration,
animator: Option<&ProtocolObject<dyn UIContextMenuInteractionAnimating>>,
)
Available on crate feature UIContextMenuConfiguration only.
fn contextMenuInteraction_willDisplayMenuForConfiguration_animator( &self, interaction: &UIContextMenuInteraction, configuration: &UIContextMenuConfiguration, animator: Option<&ProtocolObject<dyn UIContextMenuInteractionAnimating>>, )
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.
Sourcefn contextMenuInteraction_willEndForConfiguration_animator(
&self,
interaction: &UIContextMenuInteraction,
configuration: &UIContextMenuConfiguration,
animator: Option<&ProtocolObject<dyn UIContextMenuInteractionAnimating>>,
)
Available on crate feature UIContextMenuConfiguration only.
fn contextMenuInteraction_willEndForConfiguration_animator( &self, interaction: &UIContextMenuInteraction, configuration: &UIContextMenuConfiguration, animator: Option<&ProtocolObject<dyn UIContextMenuInteractionAnimating>>, )
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.
Sourcefn contextMenuInteraction_previewForHighlightingMenuWithConfiguration(
&self,
interaction: &UIContextMenuInteraction,
configuration: &UIContextMenuConfiguration,
) -> Option<Retained<UITargetedPreview>>
👎DeprecatedAvailable on crate features UIContextMenuConfiguration and UITargetedPreview only.
fn contextMenuInteraction_previewForHighlightingMenuWithConfiguration( &self, interaction: &UIContextMenuInteraction, configuration: &UIContextMenuConfiguration, ) -> Option<Retained<UITargetedPreview>>
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.
Sourcefn contextMenuInteraction_previewForDismissingMenuWithConfiguration(
&self,
interaction: &UIContextMenuInteraction,
configuration: &UIContextMenuConfiguration,
) -> Option<Retained<UITargetedPreview>>
👎DeprecatedAvailable on crate features UIContextMenuConfiguration and UITargetedPreview only.
fn contextMenuInteraction_previewForDismissingMenuWithConfiguration( &self, interaction: &UIContextMenuInteraction, configuration: &UIContextMenuConfiguration, ) -> Option<Retained<UITargetedPreview>>
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
impl ProtocolType for dyn UIContextMenuInteractionDelegate
impl<T> ImplementedBy<T> for dyn UIContextMenuInteractionDelegate
Implementations on Foreign Types§
impl<T> UIContextMenuInteractionDelegate for ProtocolObject<T>where
T: ?Sized + UIContextMenuInteractionDelegate,
Implementors§
impl UIContextMenuInteractionDelegate for UIControl
UIControl only.