Instance Method

webView:previewingViewControllerForElement:defaultActions:

Called when the user performs a peek action.

Declaration

- (UIViewController *)webView:(WKWebView *)webView previewingViewControllerForElement:(WKPreviewElementInfo *)elementInfo defaultActions:(NSArray<id<WKPreviewActionItem>> *)previewActions;

Parameters

webView

The web view invoking the delegate method.

elementInfo

The information associated with the element.

previewActions

An array of default actions used by the element.

Return Value

Return nil to use Webkit's default preview behavior. Returning a view controller allows webView:commitPreviewingViewController: to be invoked when the user performs a pop action.

Discussion

To use the default actions, your app must return the actions to be run in your view controller's implementation of previewActionItems.

See Also

Responding to Force Touch Actions

- webView:shouldPreviewElement:

Determines whether the given element should show a preview.

Deprecated
- webView:commitPreviewingViewController:

Called when the user performs a pop action on the preview.

Deprecated