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?
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.
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.
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.
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.
Alright! I found where this issue comes from… It's a constraint issue!!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With