Valentin
Valentin

Reputation: 3302

iOS - Is there a way to show Autolayout constraints while debugging?

I want to be able to see the NSLayoutConstraints that I have set between individual UILabels while debugging. Is this possible?

Upvotes: 6

Views: 2286

Answers (1)

Valentin
Valentin

Reputation: 3302

With Xcode 6, there is a way to show the constraints while debugging.

  1. Run your application on either simulator or device.
  2. Select 'Debug View Hierarchy' which appears between 'Step out' and 'Simulate Location'enter image description here

  3. Select the control that you want to view the constraints

enter image description here

  1. Select 'Show Constraints'

enter image description here

Result:

enter image description here

Upvotes: 12

Related Questions