---
title: NSStackViewDelegate
framework: appkit
role: symbol
role_heading: Protocol
path: appkit/nsstackviewdelegate
---

# NSStackViewDelegate

A set of methods you use to respond to a stack view detaching and reattaching views.

## Declaration

```swift
protocol NSStackViewDelegate : NSObjectProtocol
```

## Overview

Overview Adopt this protocol in a custom object and use it to track the addition and removal of views from the stack view’s view hierarchy. For an explanation of detachment and reattachment of a stack view’s views, see NSStackView.

## Topics

### Responding to View Detachment and Reattachment

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

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Responding to Stack-Related Changes

- [delegate](appkit/nsstackview/delegate.md)
