<!--
{
  "availability" : [
    "macOS: 10.11.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSStackView/detachesHiddenViews",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSStackView(py)detachesHiddenViews"
  },
  "title" : "detachesHiddenViews"
}
-->

# detachesHiddenViews

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

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

## Discussion

When the value of this property is <doc://com.apple.documentation/documentation/Swift/true>, setting the [`isHidden`](/documentation/AppKit/NSView/isHidden) property of a view to <doc://com.apple.documentation/documentation/Swift/true> causes the stack view to remove hidden views from its view hierarchy and put them in the [`detachedViews`](/documentation/AppKit/NSStackView/detachedViews) property. Changing the view’s [`isHidden`](/documentation/AppKit/NSView/isHidden) property to <doc://com.apple.documentation/documentation/Swift/false> causes the stack view to add the view back to the view hierarchy. When the value of this property is <doc://com.apple.documentation/documentation/Swift/false>, views remain in the view hierarchy, even when they are hidden. The default value of this property is <doc://com.apple.documentation/documentation/Swift/true>.

---

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)