How do I determine what the view structure on my iPhone program while running on the simulator?
There's a built-in way to dump the view hierarchy: recursiveDescription
recursiveDescription
NSLog(@"%@", [view recursiveDescription]);
It will output something like this:
<UIView: 0x6a107c0; frame = (0 20; 320 460); autoresize = W+H; layer = […] | <UIRoundedRectButton: 0x6a103e0; frame = (124 196; 72 37); opaque = NO; […] | | <UIButtonLabel: 0x6a117b0; frame = (19 8; 34 21); text = 'Test'; […]
See: https://developer.apple.com/library/content/technotes/tn2239/_index.html
2.1m questions
2.1m answers
60 comments
57.0k users