Created
May 22, 2014 09:15
-
-
Save croath/53a651a457d68799da94 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSArray*)findAllLabelsOfView:(UIView*)view{ | |
NSMutableArray *array = [NSMutableArray array]; | |
NSArray *subViews = view.subviews; | |
if ([view isKindOfClass:[UILabel class]]) { | |
[array addObject:view]; | |
} | |
if (subViews.count) { | |
[subViews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { | |
[array addObjectsFromArray:[self findAllLabelsOfView:obj]]; | |
}]; | |
} | |
return array; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment