<!--
{
  "availability" : [
    "macOS: 10.3.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WebUIDelegate/webView(_:createWebViewWith:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(pl)WebUIDelegate(im)webView:createWebViewWithRequest:"
  },
  "title" : "webView(_:createWebViewWith:)"
}
-->

# webView(_:createWebViewWith:)

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

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

The web view that is loading the request.

## Discussion

This method should begin loading the content for the specified request by sending [`load(_:)`](/documentation/WebKit/WebFrame/load(_:)-47p2s) to its main frame. The new window should initially be hidden. Later, a [`webViewShow(_:)`](/documentation/WebKit/WebUIDelegate/webViewShow(_:)) message is sent to the delegate of the new web view. By default, this method returns `nil`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)