Created
July 30, 2010 18:40
-
-
Save KyleLeneau/501090 to your computer and use it in GitHub Desktop.
This file contains 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
// | |
// UIView+Additions.h | |
// | |
// Created by Kyle LeNeau on 7/30/10. | |
// Copyright 2010 KyleLeNeau.com. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
@interface UIView (Additions) | |
- (void)printSubviews:(UIView *)theView; | |
@end |
This file contains 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
// | |
// UIView+Additions.m | |
// | |
// Created by Kyle LeNeau on 7/30/10. | |
// Copyright 2010 KyleLeNeau.com. All rights reserved. | |
// | |
#import "UIView+Additions.h" | |
@implementation UIView (Additions) | |
- (void)printSubviews:(UIView *)theView { | |
static NSInteger depthCount = 0; | |
NSArray *subviewArray = [theView subviews]; | |
NSMutableString *tabString = [NSMutableString stringWithCapacity:depthCount]; | |
for (int i = 0; i < depthCount; i++) { | |
[tabString appendString:@" -- "]; | |
} | |
NSLog(@"%@ %@", tabString, theView); | |
if (subviewArray) { | |
depthCount++; | |
for (UIView *v in subviewArray) { | |
[self printSubviews:v]; | |
} | |
depthCount--; | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment