Monday, January 19, 2015

View Debugging in Xcode 6

Overview :

Xcode 6 makes debugging your app's user interface much easier with the live view debugging feature. You are now able to pause your running app and dissect the paused user interface in a 3D view. The view debugger shows you your view hierarchy and Auto Layout constraints. If you select a view, you can inspect its properties in the inspector or jump to the relevant code in the assistant editor. With this, you can inspect issues such issues as Auto Layout conflicts, see why a view is hidden or clipped, etc.

To start the live view debugger :

1. Create a new project in Xcode
2. Design a sample page with multiple views under storyboard

3. Now launch your app and click the Debug View Hierarchy button on the debug toolbar.

Your app pauses and you're presented with a 3D visualization of its user interface. You can drag anywhere on the canvas to rotate the view

You can switch between various view states with the buttons below the canvas.

From left to right :

Show Clipped Content: This option hides or shows content that's being clipped in a selected view.

Show Constraints: It shows the Auto Layout constraints of a selected view.

Reset Viewing Area: This resets the canvas to its default state.

Adjust View Mode: This mode lets you select how you want to see your views. There's an option to see it as a wireframe, the view's contents, or both.

Zoom Out, Actual Size, Zoom In: This lets you set the view's scale.

Hyder Ali is a Junior Software Engineer at Span Technology Services

No comments:

Post a Comment