View Debugging: What are the layers of view in any View Controller?

3.1k views Asked by At

For example, when I add a table view to my view controller what would the view hierarchy be? Is UIWindow always the base View of the hierarchy? In which layer does the Status Bar lie?

I mostly write code programmatically, therefore, have some queries while visualizing the hierarchy.

1

There are 1 answers

0
SachinVsSachin On BEST ANSWER

The Xcode debugger provides the ability to inspect and understand the view hierarchy.

With your app running in the debugger, click the Debug View Hierarchy button in the debug bar. enter image description here

Here is reference of visual code debugging. https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/debugging_with_xcode/chapters/special_debugging_workflows.html

enter image description here