The following is how to determine if an Object is a class: object-c code:
for (UIView * view in btn.superview.superview.subviews) { if (! [view isKindOfClass:[UILabel class]]) { } }Copy the code
The above code is still relatively common, how to convert the Internet is emerging in endlessly, however, the effect is very little, the blogger pro test the following method is effective:
for var view in (btn.superview? .superview? .subviews)! { if ! The isKindOfClass (UILabel) {}}Copy the code
This problem appears in the blogger’s custom tabbar, with interest in the following blog posts.