Você já colocou algum elemento em uma UIView e ele não ficou do jeito que queria? Esse post é pra você!

Image for post
Image for post

Alguma vez você já colocou algum elemento em uma UIView e, ao olhar no simulador, percebeu que ele não se apresentava do jeito que estava imaginando?

Bem, o nosso querido Xcode tem uma função muito útil para inspeção de elementos visuais que pode ajudar nesses casos, chamada Debug View Hierarchy, ou View Debugger. A função pode ser ativada no botão indicado abaixo, localizado no debugger do Xcode.


Have you ever added an element in an UIView and after checking in the simulator you realized that it was not what you were expecting?

Well, our beloved Xcode has a very useful feature for inspecting visual elements, which is called View Debugger. This feature can be activated while your app is running by clicking in the button indicated in the image below, located in the debugger bar.

Image for post
Image for post

Getting to know the View Debugger

After clicking on the View Debugger button, Xcode will pause the execution of your application and capture the state of your current window.

A screen similar to the one below will appear for you. Let’s try to understand what Xcode is showing us. …

About

Gabriel Sória

iOS software engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store