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

# isDescendant(of:)

Returns a Boolean value indicating whether the receiver is a subview of a given view or identical to that view.

## Declaration

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

## Parameters

- `view`: The view to test against the receiver’s view hierarchy.

## Return Value

Return Value true if the receiver is an immediate or distant subview of view or if view is the receiver itself; otherwise false.

## See Also

### Managing the view hierarchy

- [superview](uikit/uiview/superview.md)
- [subviews](uikit/uiview/subviews.md)
- [window](uikit/uiview/window.md)
- [addSubview(_:)](uikit/uiview/addsubview(_:).md)
- [bringSubviewToFront(_:)](uikit/uiview/bringsubviewtofront(_:).md)
- [sendSubviewToBack(_:)](uikit/uiview/sendsubviewtoback(_:).md)
- [removeFromSuperview()](uikit/uiview/removefromsuperview().md)
- [insertSubview(_:at:)](uikit/uiview/insertsubview(_:at:).md)
- [insertSubview(_:aboveSubview:)](uikit/uiview/insertsubview(_:abovesubview:).md)
- [insertSubview(_:belowSubview:)](uikit/uiview/insertsubview(_:belowsubview:).md)
- [exchangeSubview(at:withSubviewAt:)](uikit/uiview/exchangesubview(at:withsubviewat:).md)
