Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +(void) logViewHeirachyOfView:(UIView *) aView{
- NSString *indent=@"";
- NSMutableArray *superViews=[NSMutableArray arrayWithCapacity:1];
- //NSMutableArray *subViews=[NSMutableArray arrayWithCapacity:1];
- if (aView.superview) {
- UIView *aSuperView=aView;
- while (aSuperView.superview) {
- [superViews insertObject:aSuperView.superview atIndex:0];
- aSuperView=aSuperView.superview;
- }
- }
- for (UIView *eachView in superViews) {
- NSLog(@"%@%@:%@",indent,[eachView class],NSStringFromCGRect(eachView.frame) );
- indent=[indent stringByAppendingString:@" "];
- }
- NSLog(@"%@%@:%@ <------- Sampled View",indent,[aView class],NSStringFromCGRect(aView.frame) );
- if (aView.subviews) {
- indent=[indent stringByAppendingString:@" "];
- for (UIView *eachView in aView.subviews) {
- [DebugUIView logSubViewsOfView:eachView withIndent:indent];
- }
- }
- }//------------------------------------logViewHeirachyOfView:------------------------------------
- +(void) logSubViewsOfView:(UIView *) aView withIndent:(NSString *) anIndent{
- if (aView.subviews) {
- NSString *indent=[anIndent stringByAppendingString:@" "];
- for (UIView *eachView in aView.subviews) {
- NSLog(@"%@%@:%@",indent,[eachView class],NSStringFromCGRect(eachView.frame) );
- if (eachView.subviews) {
- for (UIView *eachSubView in aView.subviews) {
- [DebugUIView logSubViewsOfView:eachSubView withIndent:indent];
- }
- }
- }
- }
- }//------------------------------------logSubViewsOfView:------------------------------------
- +(void) logViewsForWindow:(UIWindow *) aWindow{
- NSLog(@"%@:%@",[aWindow class],NSStringFromCGRect(aWindow.frame) );
- if (aWindow.subviews) {
- [DebugUIView logSubViewsOfView:aWindow withIndent:@""];
- }
- }//------------------------------------logViewsForWindow:------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement