iOS view hierarchy
Sometimes it is usefeul to find the view hierarchy of a certain graphical component.
On iOS, here's a small code snippet to do this:
- (void) printViews:(UIView *)view marker:(NSString *)s{
for(UIView *v in view.subviews){
NSString *s2 = [s stringByAppendingString:@"*"];
NSLog(@"%@ %@", s2, v);
[self printViews:v marker:s2];
}
}
Written by Adolfo
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Objective-c
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#