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

# didAddSubview(_:)

Tells the view that a subview was added.

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

## Parameters

`subview`

The view that was added as a subview.

## Discussion

The default implementation of this method does nothing. Subclasses can override it to perform additional actions when subviews are added. This method is called in response to adding a subview using any of the relevant view methods.

## See Also

[`insertSubview(_:belowSubview:)`](/documentation/UIKit/UIView/insertSubview(_:belowSubview:))

Inserts a view below another view in the view hierarchy.

[`insertSubview(_:aboveSubview:)`](/documentation/UIKit/UIView/insertSubview(_:aboveSubview:))

Inserts a view above another view in the view hierarchy.

[`addSubview(_:)`](/documentation/UIKit/UIView/addSubview(_:))

Adds a view to the end of the receiver’s list of subviews.

[`insertSubview(_:at:)`](/documentation/UIKit/UIView/insertSubview(_:at:))

Inserts a subview at the specified index.



---

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)