Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Debug View Hierarchy finding viewcontroller

Does the Debug View Hierarchy in Xcode allow me to see what view controller owns a view?

like image 724
justdan0227 Avatar asked Jun 18 '16 15:06

justdan0227


1 Answers

Update: Starting with Xcode 9, view controllers are listed right along the view hierarchy in the visual debugger.

You can get the memory address of the selected view from the inspector in Xcode and then use the console to get the view's view controller using -nextResponder.

http://developer.apple.com/library/ios/documentation/uikit/reference/UIResponder_Class/Reference/Reference.html#//apple_ref/occ/instm/UIResponder/nextResponder

UIView implements this method by returning the UIViewController object that manages it (if it has one) or its superview (if it doesn’t)

like image 90
wolfrevo Avatar answered Nov 06 '22 06:11

wolfrevo