<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIView/willRemoveSubview(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIView(im)willRemoveSubview:"
  },
  "title" : "willRemoveSubview(_:)"
}
-->

# willRemoveSubview(_:)

Tells the view that a subview is about to be removed.

```
func willRemoveSubview(_ subview: UIView)
```

## Parameters

`subview`

The subview that will be removed.

## Discussion

The default implementation of this method does nothing. Subclasses can override it to perform additional actions whenever subviews are removed. This method is called when the subview’s superview changes or when the subview is removed from the view hierarchy completely.

## See Also

[`removeFromSuperview()`](/documentation/UIKit/UIView/removeFromSuperview())

Unlinks the view from its superview and its window, and removes it from the responder chain.



---

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)