Here we used two different views. A parent view is a view in which we look for a child and check if the parent view is added to the parent or not.
if parentView.subviews.contains(descendantView) { // descendant view added to the parent view. }else{ // descendant view not added to the parent view. }
source share