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

# isDescendant(of:)

Returns a Boolean value that indicates whether the view is a subview of the specified view.

```
func isDescendant(of view: NSView) -> Bool
```

## Parameters

`view`

The view to test for subview relationship within the view hierarchy.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the view is a subview, or distant subview, of the specified view.

## Discussion

The method returns <doc://com.apple.documentation/documentation/Swift/true> if the view is either an immediate or distant subview of `aView`.

---

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)