Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode View Debugger: How can I reveal in the hierarchy the selection in the 3-D inspector?

In the Xcode 9 view debugger, I'd like to select a view in the 3-D exploded diagram of views, and then reveal that view in the hierarchy on the left. I know I can "focus" on that view by double-clicking it or selecting "Focus on UIView" from the contextual menu. I know I can also filter by some part of the type of view I want to find, but I actually just want to view I have selected in the context of the complete hierarchy in a single step. I haven't found a way of doing this-- am I missing something?

like image 887
Wolf McNally Avatar asked Dec 06 '17 02:12

Wolf McNally


People also ask

How do you debug a view hierarchy?

First, launch a project with some interesting UI. Project 13, for example, has enough in there to be interesting. Now run the program as normal, then in Xcode go to the Debug menu and choose View Debugging > Capture View Hierarchy. After a few seconds of thinking, Xcode will show you a screenshot of your app's UI.

What is view hierarchy in Swift?

UIView hierarchy is a tree with it's root in a window ( UIWindow is a subclass of UIView ). We can traverse this tree using subviews and superview properties. UIViewController hierarchy starts from the rootViewController of a window.

How do I debug in Xcode step by step?

When you run an application in Xcode, the debugger is automatically started and attached to the process of the application. Click the Run button in the top left or press Command + R. From the moment the application is up and running, we can start inspecting the process and, if necessary, debug it.

Does Xcode have a debugger?

The Xcode debugger provides several methods to step through your code and inspect variables. You can precisely control execution of your code from a breakpoint, stepping into and out of called functions as necessary to determine where your bug occurs.


1 Answers

You can use the Xcode menu item "Navigate / Reveal in Debug Navigator" to reveal the selected item in the outline view.

Or the convenient keyboard shortcut ⌘ + Shift + D.

like image 196
Chris Miles Avatar answered Dec 08 '22 02:12

Chris Miles