---
title: viewDidMoveToSuperview()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nsview/viewdidmovetosuperview()
---

# viewDidMoveToSuperview()

Informs the view that its superview has changed (possibly to nil).

## Declaration

```swift
func viewDidMoveToSuperview()
```

## Discussion

Discussion The default implementation does nothing; subclasses can override this method to perform whatever actions are necessary.

## See Also

### Responding to View-Related Notifications

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