---
title: viewDidMoveToWindow()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nsview/viewdidmovetowindow()
---

# viewDidMoveToWindow()

Informs the view that it has been added to a new view hierarchy.

## Declaration

```swift
func viewDidMoveToWindow()
```

## Discussion

Discussion The default implementation does nothing; subclasses can override this method to perform whatever actions are necessary. If the view’s window property is nil, that result signifies that the view was removed from its window and does not currently reside in any window.

## See Also

### Responding to View-Related Notifications

- [didAddSubview(_:)](appkit/nsview/didaddsubview(_:).md)
- [viewDidMoveToSuperview()](appkit/nsview/viewdidmovetosuperview().md)
- [viewWillMove(toSuperview:)](appkit/nsview/viewwillmove(tosuperview:).md)
- [viewWillMove(toWindow:)](appkit/nsview/viewwillmove(towindow:).md)
- [willRemoveSubview(_:)](appkit/nsview/willremovesubview(_:).md)
