Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode - Debug View Hierarchy

I'm trying to debug my app's view hierarchy and a little purple square appeared on the left pane of Xcode's window (see screenshot).

Any idea what that issue could be?

Xcode - Debug View Hierarchy

like image 322
Berty86 Avatar asked Apr 05 '18 04:04

Berty86


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.

How to debug View Xcode?

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.

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 a view in SwiftUI?

Using LLDB to debug a change LLDB is our debugging tool available inside the Xcode console. It allows us to print objects using po object and find out state while our application is paused by, for example, a breakpoint. Debugging SwiftUI views using Self. _printChanges() to find a redraw trigger.


1 Answers

Alright! I found where this issue comes from… It's a constraint issue!!!

enter image description here

like image 102
Berty86 Avatar answered Oct 20 '22 15:10

Berty86