Skip to content

Instantly share code, notes, and snippets.

@lucascorrea
Last active June 6, 2016 18:18
Show Gist options
  • Save lucascorrea/965e653e8a1ea394de1a1683a0f032ee to your computer and use it in GitHub Desktop.
Save lucascorrea/965e653e8a1ea394de1a1683a0f032ee to your computer and use it in GitHub Desktop.
Debug Constraints

You'll want to add a Symbolic Breakpoint. Apple provides an excellent guide on how to do this.

1 Open the Breakpoint Navigator cmd+7

2 Click the Add button in the lower left

3 Select Add Symbolic Breakpoint...

4 Where it says Symbol just type in UIViewAlertForUnsatisfiableConstraints

Add action expression below

Obj-C project

po [[UIWindow keyWindow] _autolayoutTrace]

Swift project

expr -l objc++ -O -- [[UIWindow keyWindow] _autolayoutTrace]

Alt text

###Change color object error expr ((UIView *)0x7f88a8cc2050).backgroundColor = [UIColor redColor]

http://stackoverflow.com/questions/26389273/how-to-trap-on-uiviewalertforunsatisfiableconstraints

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment