---
title: "willMove(toSuperview:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiview/willmove(tosuperview:)"
---

# willMove(toSuperview:)

Tells the view that its superview is about to change to the specified superview.

## Declaration

```swift
func willMove(toSuperview newSuperview: UIView?)
```

## Parameters

- `newSuperview`: A view object that will be the new superview of the receiver. This object may be nil.

## Discussion

Discussion The default implementation of this method does nothing. Subclasses can override it to perform additional actions whenever the superview changes.

## See Also

### Observing view-related changes

- [didAddSubview(_:)](uikit/uiview/didaddsubview(_:).md)
- [willRemoveSubview(_:)](uikit/uiview/willremovesubview(_:).md)
- [didMoveToSuperview()](uikit/uiview/didmovetosuperview().md)
- [willMove(toWindow:)](uikit/uiview/willmove(towindow:).md)
- [didMoveToWindow()](uikit/uiview/didmovetowindow().md)
