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

# removeView(_:)

Removes a specified view from the stack view.

```
func removeView(_ view: NSView)
```

## Parameters

`view`

The view you want to remove from the stack view.
  
  > Important:
  > If you attempt to remove a view that is not in the stack view, the system raises an exception.

## Discussion

This method removes a view from a stack view whether the view is attached or detached. For an attached view only, you can alternatively call the <doc://com.apple.documentation/documentation/UIKit/UIView/removeFromSuperview()> method on the view.

---

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)