Instance Method

webView(_:shouldPreviewElement:)

Determines whether the given element should show a preview.

Declaration

optional func webView(_ webView: WKWebView, shouldPreviewElement elementInfo: WKPreviewElementInfo) -> Bool

Parameters

webView

The web view invoking the delegate method.

elementInfo

The information associated with the element.

Return Value

Return NO to disable previews for the given element.

Discussion

This method is only invoked for elements that have a default preview in WebKit.

See Also

Responding to Force Touch Actions

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software