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