Skip to content

Instantly share code, notes, and snippets.

@xNekOIx
Last active July 7, 2020 17:45
Show Gist options
  • Save xNekOIx/6121100 to your computer and use it in GitHub Desktop.
Save xNekOIx/6121100 to your computer and use it in GitHub Desktop.
iOS AutoLayout debug
po [[UIWindow keyWindow] _autolayoutTrace] // prints layouts ambiguity
po [UIViewController _printHierarchy] // prints view controllers hierarchy
po [view constraintsAffectingLayoutForAxis:0] // horizontal
po [view constraintsAffectingLayoutForAxis:1] // vertical
[view hasAmbiguousLayout] // BOOL
[view exerciseAmbiguityInLayout] // visualizing ambiguity
UIViewAlertForUnsatisfiableConstraints // symbolic breakpoint
UIConstraintBasedLayoutDebugging // symbolic breakpoint
expr (void)[CATransaction flush]
command alias objcpo po -l objc++ -O --
command alias objcexpr expr -l objc++ -O --
Swift:
e let $sv = unsafeBitCast(0x7fe33d355b10, UIStackView.self)
po $sv.constraintsAffectingLayoutForAxis(.Horizontal)
po $sv.constraintsAffectingLayoutForAxis(.Vertical)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment