Instance Method

contextMenuInteraction:previewForHighlightingMenuWithConfiguration:

Returns the source view to use when animating the appearance of the preview interface.

Declaration

- (UITargetedPreview *)contextMenuInteraction:(UIContextMenuInteraction *)interaction previewForHighlightingMenuWithConfiguration:(UIContextMenuConfiguration *)configuration;

Parameters

interaction

The interaction object that triggered the preview.

configuration

The configuration object associated with the current interaction.

Return Value

An object containing the source view and configuration parameters for the animation.

Discussion

UIKit calls this method before an interaction begins, to give you an opportunity to supply a custom source view for the presentation animations. If you didn't provide a preview handler block in the configuration data, UIKit displays the specified view in the preview interface.

See Also

Customizing the Preview Animations

- contextMenuInteraction:previewForDismissingMenuWithConfiguration:

Returns the destination view to use when animating the appearance of the preview interface.

Adding Menus and Shortcuts to the Menu Bar and User Interface

Provide quick access to useful actions by adding menus and keyboard shortcuts to your Mac Catalyst app.