Instance Method

webView(_:createWebViewWith:for:windowFeatures:)

Creates a new web view.

Declaration

optional func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView?

Parameters

webView

The web view invoking the delegate method.

configuration

The configuration to use when creating the new web view.

navigationAction

The navigation action causing the new web view to be created.

windowFeatures

Window features requested by the webpage.

Return Value

A new web view or nil.

Discussion

The web view returned must be created with the specified configuration. WebKit loads the request in the returned web view.