Reputation: 1362
Does the Debug View Hierarchy in Xcode allow me to see what view controller owns a view?
Upvotes: 11
Views: 6333
Reputation: 2032
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
.
UIView implements this method by returning the UIViewController object that manages it (if it has one) or its superview (if it doesn’t)
Upvotes: 17