Skip to content

Instantly share code, notes, and snippets.

@oropon
Created March 14, 2013 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oropon/5160008 to your computer and use it in GitHub Desktop.
Save oropon/5160008 to your computer and use it in GitHub Desktop.
compact recursiveDescription-block
NSString*(^__block __weak r)(id,int)=^(id v,int d){NSMutableString*m,*l;m=[NSMutableString string];l=[NSMutableString string];for(id _ in [v subviews])[m appendString:r(_,d+1)];for(int i=0;i<d;i++)[l appendString:@" | "];return[NSString stringWithFormat:@"%@%@\n%@",l,[v description], m];};
NSLog(@"\n%@", r(<#target_view#>, 0));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment