---
title: "stackView(_:didReattach:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsstackviewdelegate/stackview(_:didreattach:)"
---

# stackView(_:didReattach:)

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

## Declaration

```swift
@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

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 array.

## See Also

### Responding to View Detachment and Reattachment

- [stackView(_:willDetach:)](appkit/nsstackviewdelegate/stackview(_:willdetach:).md)
