<!--
{
  "availability" : [
    "macOS: 10.9.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSStackViewDelegate/stackView(_:didReattach:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSStackViewDelegate(im)stackView:didReattachViews:"
  },
  "title" : "stackView(_:didReattach:)"
}
-->

# stackView(_:didReattach:)

Called when the stack view has automatically reattached one or more previously-detached views.

```
@MainActor optional func stackView(_ stackView: NSStackView, didReattach views: [NSView])
```

## Parameters

`stackView`

The stack view that has reattached one or more detached views.

`views`

An array of one or more views, managed by the stack view, that were reattached.

## Discussion

To configure a custom class to respond to the automatic reattachment of views to a stack view’s view hierarchy, implement this method in the class. This method is not called when your code explicitly adds a view to a stack view’s [`views`](/documentation/AppKit/NSStackView/views) array.

---

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)