<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSView/didAddSubview(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSView(im)didAddSubview:"
  },
  "title" : "didAddSubview(_:)"
}
-->

# didAddSubview(_:)

Overridden by subclasses to perform additional actions when subviews are added to the view.

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

## Parameters

`subview`

The view that was added as a subview.

## Discussion

This method is invoked by [`addSubview(_:)`](/documentation/AppKit/NSView/addSubview(_:)).

---

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)