---
title: detachesHiddenViews
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsstackview/detacheshiddenviews
---

# detachesHiddenViews

A Boolean value that indicates whether the stack view removes hidden views from its view hierarchy.

## Declaration

```swift
var detachesHiddenViews: Bool { get set }
```

## Discussion

Discussion When the value of this property is true, setting the isHidden property of a view to true causes the stack view to remove hidden views from its view hierarchy and put them in the detachedViews property. Changing the view’s isHidden property to false causes the stack view to add the view back to the view hierarchy. When the value of this property is false, views remain in the view hierarchy, even when they are hidden. The default value of this property is true.

## See Also

### Configuring Dynamic Behavior for a Stack View

- [setClippingResistancePriority(_:for:)](appkit/nsstackview/setclippingresistancepriority(_:for:).md)
- [setHuggingPriority(_:for:)](appkit/nsstackview/sethuggingpriority(_:for:).md)
