Visual View Debugging in iOS - raywenderlich.com

Share this & earn $10
raywenderlich.com
Published at : 01 Jan 2021
3779 views
66
1

Xcode's view debugger has some improvements that make it easy to debug even code-based Auto Layout issues. Discover how in this screencast.

View other screencasts over here:
https://videos.raywenderlich.com/screencasts

----
About www.raywenderlich.com:

raywenderlich.com is a website focused on developing high quality programming tutorials. Our goal is to take the coolest and most challenging topics and make them easy for everyone to learn – so we can all make amazing apps.

We are also focused on developing a strong community. Our goal is to help each other reach our dreams through friendship and cooperation. As you can see below, a bunch of us have joined forces to make this happen: authors, editors, subject matter experts, app reviewers, and most importantly our amazing readers!

----

Debugging View Hierarchies

Some bugs are immediately visible to the eye because they are problems with the views your app uses in the UI. For instance, misplaced graphics on the screen; the wrong picture associated with an item; pictures, labels, or text that are incorrectly clipped or placed—these are all examples of issues with an app’s view hierarchy.

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

Basic Operation

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

When you debug view hierarchies, Xcode pauses your app in its current state and reconfigures the main window. The tools to debug view hierarchies are integrated throughout the Xcode main window. The main source editor window shows an interactive 3D model of the currently selected window in the main editor. The debug navigator process view changes to display your app’s view hierarchy as a hierarchical list. In the Xcode utility pane, the inspector selector bar now includes buttons for an object inspector and size inspector, all pertaining to your app’s views.

The view of the currently selected window in the main editor is an active representation of all the views in the window. To rotate the window being displayed in the main editor, drag it. The views are exploded into three dimensions so that you can visualize the layer hierarchy and see the relationships between views in that hierarchy. A two-finger drag allows you to shift the position of the view display in the main editor; this becomes very useful when you magnify the views to examine details of the view hierarchy. Clicking an object in the exploded view hierarchy populates the object and size inspectors in the utility pane, and indicates the selection in the hierarchical list displayed in the debug navigator.

At the bottom of the main editor there are additional controls for manipulating the exploded view display. The left slider allows you to adjust the spacing between the views so you can see individual view objects more easily. The right slider allows you to filter the views from back-to-front or front-to-back so you can home in on a particular view in a complex hierarchy.

A set of control buttons is located between the two sliders. From left to right:

Use the Clipping button to reveal clipped content of all views that are displayed in the main editor.

Click the Show Constraints button to display Auto Layout constraints of the currently selected view layer in the main editor. When you turn on Show Constraints and click in a view object, other view objects are dimmed to allow you to see the constraints associated with this object more clearly.

Use the Reset button to return the main editor display to the default 2D orientation.

Click the View Mode button to select whether to display view

Contents, Wireframes, or Wireframes and Contents in the main
editor.

The zoom controls allow you to increase and decrease the displayed magnification, or return the display to standard size. You can also zoom in and out using pinch gestures on a trackpad. If you prefer using a mouse, holding down the Option key and using the scroll wheel is another way to zoom.
ios debuggingios view debugginguiview

The Battle Over Ballots | Ep. 60

The Battle Over Ballots | Ep. 60

'I don't have any words' | 29 people found in Houston home after man escapes alleged human smuggling

'I don't have any words' | 29 people found in Houston home after man escapes alleged human smuggling

Geronimo tv clip  Raiding for horses to offer sweetheart's father as gifts and proof of being a good

Geronimo tv clip Raiding for horses to offer sweetheart's father as gifts and proof of being a good

NY officer is alleged China spy; Massive explosions in China's capital; Trump's Supreme Court list

NY officer is alleged China spy; Massive explosions in China's capital; Trump's Supreme Court list

Tour the Newest Modern Mansion in Miami Beach Offered at $23.5 MILLION

Tour the Newest Modern Mansion in Miami Beach Offered at $23.5 MILLION

Selecting the best model in scikit-learn using cross-validation

Selecting the best model in scikit-learn using cross-validation

Cléopatre de Mérode (1873-1966) - Film of a Larger Than Life Figure and Dancer on Film

Cléopatre de Mérode (1873-1966) - Film of a Larger Than Life Figure and Dancer on Film

St Augustine Shelling - St John's County Ocean Pier - Lots of Little Shells

St Augustine Shelling - St John's County Ocean Pier - Lots of Little Shells

Razer Sent Me a GIANT GAMING PACKAGE!

Razer Sent Me a GIANT GAMING PACKAGE!

Analysis of Francis Bacon's Of Parents and Children by  Fr. Dr. Binny Mathew

Analysis of Francis Bacon's Of Parents and Children by Fr. Dr. Binny Mathew

5 Best Handbags to JUMPSTART Your Luxury Collection

5 Best Handbags to JUMPSTART Your Luxury Collection

Understanding Pesticides Part I

Understanding Pesticides Part I

Abundant Meaning

Abundant Meaning

How to Open Private Or Incognito Browsing Session In Google Chrome [Tutorial]

How to Open Private Or Incognito Browsing Session In Google Chrome [Tutorial]

Stylish and Classy Dress Styles for the Curvy, Bold and Beautiful: +40 Stunning African Dress Styles

Stylish and Classy Dress Styles for the Curvy, Bold and Beautiful: +40 Stunning African Dress Styles

GOTTA KEEP THAT ZEAL

GOTTA KEEP THAT ZEAL

Trial of man alleged to have supplied gun to Duggan

Trial of man alleged to have supplied gun to Duggan

SOMEONE STOP THIS MADMAN! (Flex Tape)

SOMEONE STOP THIS MADMAN! (Flex Tape)

Che fatica le relazioni sociali!

Che fatica le relazioni sociali!

Husbands' weekend morning routine (two nice bois)

Husbands' weekend morning routine (two nice bois)

Every AT-Walker Type and Variant in Star Wars Canon (2020)

Every AT-Walker Type and Variant in Star Wars Canon (2020)

Why Sales Professionals Should Purchase a Cold Calling List

Why Sales Professionals Should Purchase a Cold Calling List

Installing BRB Taillights Step By Step for Dummies Like Me

Installing BRB Taillights Step By Step for Dummies Like Me

JoJo Siwa - BOOMERANG (Official Video)

JoJo Siwa - BOOMERANG (Official Video)

The Technology of Writing: From Stone Tablets to Tablet Devices

The Technology of Writing: From Stone Tablets to Tablet Devices

My Little Brony

My Little Brony

Why Workwear is a Wardrobe essential

Why Workwear is a Wardrobe essential

Forgotten Gunfighters: The Pleasant Valley War

Forgotten Gunfighters: The Pleasant Valley War

"The Queen's Gambit" Analysis | Mental Health & Personality

"The Queen's Gambit" Analysis | Mental Health & Personality

School House Rock - The Constitution

School House Rock - The Constitution

Message to Coaches and Parents, "Accurate Rosters are Vitally Important"

Message to Coaches and Parents, "Accurate Rosters are Vitally Important"

It's Good to be Gordon (HD - UK)

It's Good to be Gordon (HD - UK)

In Fact - A.D.R.E.N.A.L.I.N.A. (dir. ksmv_)

In Fact - A.D.R.E.N.A.L.I.N.A. (dir. ksmv_)

Top 5 stock metrics to analyze a company.

Top 5 stock metrics to analyze a company.

Mozzy - Be Here ft. June

Mozzy - Be Here ft. June

Vasuvum Saravananum Onna Padichavanga - Naa Romba Busy Video | Arya, Santhanam | D. Imman

Vasuvum Saravananum Onna Padichavanga - Naa Romba Busy Video | Arya, Santhanam | D. Imman

Ghost Pepper Chilli Showdown - Guinness World Records

Ghost Pepper Chilli Showdown - Guinness World Records

Mum Says Her Daughter Kelly Looks 'Hideous' | S5 EP1 | Snog, Marry, Avoid?

Mum Says Her Daughter Kelly Looks 'Hideous' | S5 EP1 | Snog, Marry, Avoid?

LIVE SESSION STRUCTURES (TOP10 PRIX 2021)

LIVE SESSION STRUCTURES (TOP10 PRIX 2021)

Nemzzz - Transparent (Music Video) | @MixtapeMadness

Nemzzz - Transparent (Music Video) | @MixtapeMadness

Makyajlı Skoda Superb 1.5 TSI | Passat'tan iyi mi? | Neden Almalı?

Makyajlı Skoda Superb 1.5 TSI | Passat'tan iyi mi? | Neden Almalı?

ViViD Dear ( Final Live 2015 )

ViViD Dear ( Final Live 2015 )

Dollar - Who Were You With in the Moonlight?

Dollar - Who Were You With in the Moonlight?

Fantastic!! Morah Like Bonny in farming with Original Sound - By Animals Daily-Life

Fantastic!! Morah Like Bonny in farming with Original Sound - By Animals Daily-Life

Cops trying to harass me at Astoria Park

Cops trying to harass me at Astoria Park

This devlog isn't like the others  - DEVLOG 15

This devlog isn't like the others - DEVLOG 15

HOW TO USE EMBOSSING FOLDERS AND LARGE WORD DIES - HIDDEN MESSAGE CARD INK BLENDING - HANDMADE CARDS

HOW TO USE EMBOSSING FOLDERS AND LARGE WORD DIES - HIDDEN MESSAGE CARD INK BLENDING - HANDMADE CARDS

Legend of the General ft. Deniz Kirci by Sami J. Laine | Most Epic Heroic Choir Ochestral

Legend of the General ft. Deniz Kirci by Sami J. Laine | Most Epic Heroic Choir Ochestral

Class40 Redman LIVE at the Start - RORC Transatlantic Race

Class40 Redman LIVE at the Start - RORC Transatlantic Race