I have been using the following code to loop through specific classes in my subviews.
for (int i = 0; i < [[self.view subviews] count]; i++) {
if ([[self.view.subviews objectAtIndex:i] class] == [UIButton class]) {
}
}
But i feel like there should be a better way. Could someone please help me out?
Thanks.
for(UIView *v in [self.view subviews]) { if ([v isKindOfClass:[UIButton class]]) { ... } }