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

# webView(_:createWebViewWith:)

Creates a window containing a web view to load the specified request.

## Declaration

```swift
optional func webView(_ sender: WebView!, createWebViewWith request: URLRequest!) -> WebView!
```

## Parameters

- `sender`: The web view that sent the message.
- `request`: The request to load.

## Return Value

Return Value The web view that is loading the request.

## Discussion

Discussion This method should begin loading the content for the specified request by sending load(_:) to its main frame. The new window should initially be hidden. Later, a webViewShow(_:) message is sent to the delegate of the new web view. By default, this method returns nil.

## See Also

### Creating and Closing Windows

- [webView(_:createWebViewModalDialogWith:)](webkit/webuidelegate/webview(_:createwebviewmodaldialogwith:).md)
- [webViewRunModal(_:)](webkit/webuidelegate/webviewrunmodal(_:).md)
- [webViewClose(_:)](webkit/webuidelegate/webviewclose(_:).md)
