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

# viewDidHide()

Invoked when the view is hidden, either directly, or in response to an ancestor being hidden.

```
func viewDidHide()
```

## Discussion

The view receives this message when its [`isHiddenOrHasHiddenAncestor`](/documentation/AppKit/NSView/isHiddenOrHasHiddenAncestor) property changes from <doc://com.apple.documentation/documentation/Swift/false> to <doc://com.apple.documentation/documentation/Swift/true>. This happens when the view or an ancestor is marked as hidden, or when the view or an ancestor is inserted into a new view hierarchy.

---

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)