for subview in view.subviews { if subview is UIButton { // this subview is UIButton } else if subview is UILabel { // this subview is UILabel } }