---
title: "isDescendant(of:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsview/isdescendant(of:)"
---

# isDescendant(of:)

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

## Declaration

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

## Parameters

- `view`: The view to test for subview relationship within the view hierarchy.

## Return Value

Return Value true if the view is a subview, or distant subview, of the specified view.

## Discussion

Discussion The method returns true if the view is either an immediate or distant subview of aView.

## See Also

### Getting the Related Objects

- [superview](appkit/nsview/superview.md)
- [subviews](appkit/nsview/subviews.md)
- [window](appkit/nsview/window.md)
- [opaqueAncestor](appkit/nsview/opaqueancestor.md)
- [ancestorShared(with:)](appkit/nsview/ancestorshared(with:).md)
- [enclosingMenuItem](appkit/nsview/enclosingmenuitem.md)
- [enclosingScrollView](appkit/nsview/enclosingscrollview.md)
