---
title: "webView(_:createWebViewWith:for:windowFeatures:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkuidelegate/webview(_:createwebviewwith:for:windowfeatures:)"
---

# webView(_:createWebViewWith:for:windowFeatures:)

Creates a new web view.

## Declaration

```swift
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

Return Value A new web view or nil.

## Discussion

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

## See Also

### Creating and closing the web view

- [webViewDidClose(_:)](webkit/wkuidelegate/webviewdidclose(_:).md)
