<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSVisualEffectView/viewWillMove(toWindow:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSVisualEffectView(im)viewWillMoveToWindow:"
  },
  "title" : "viewWillMove(toWindow:)"
}
-->

# viewWillMove(toWindow:)

Notifies the view immediately before it moves to a new window (which may be `nil`).

```
func viewWillMove(toWindow newWindow: NSWindow?)
```

## Parameters

`newWindow`

The window object that will be at the root of the view’s new view hierarchy. If the view is being removed from a window and there isn’t a new window, this parameter is `nil`.

## Discussion

When subclassing, you can override this method and use it to perform any tasks associated with the change. You must call `super` at some point during your implementation.

---

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)