---
title: "webViewClose(_:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webuidelegate/webviewclose(_:)"
---

# webViewClose(_:)

Closes a web view in a window.

## Declaration

```swift
optional func webViewClose(_ sender: WebView!)
```

## Parameters

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

## Discussion

Discussion If you display multiple web views in a window then you might want to close only sender in your implementation. By default, this method sends the close() method to the NSWindow object that contains sender.

## See Also

### Creating and Closing Windows

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