---
title: "viewWillMove(toHostWindow:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webdocumentview/viewwillmove(tohostwindow:)"
---

# viewWillMove(toHostWindow:)

Invoked when a web view’s host window is about to change.

## Declaration

```swift
func viewWillMove(toHostWindow hostWindow: NSWindow!)
```

## Parameters

- `hostWindow`: The new host window for the view.

## See Also

### Related Documentation

- [hostWindow](webkit/webview-swift.class/hostwindow.md)

### Attaching to a window

- [viewDidMoveToHostWindow()](webkit/webdocumentview/viewdidmovetohostwindow().md)
