21

Xcode shows lengthy warnings to unsatisfiable auto layout constrains.So it is difficult to find other exceptions from the console among them. Is there any way to disable auto layout related warnings in Xcode?

Jamie Taylor
  • 4,709
  • 5
  • 44
  • 66
Makmeksum
  • 463
  • 1
  • 4
  • 14

3 Answers3

14

Swift 4:

UserDefaults.standard.set(false, forKey: "_UIConstraintBasedLayoutLogUnsatisfiable")
Adam Bardon
  • 3,829
  • 7
  • 38
  • 73
9
[[NSUserDefaults standardUserDefaults] setValue:@(NO) forKey:@"_UIConstraintBasedLayoutLogUnsatisfiable"];

Add this code inside appdelegate. This will hide constraint error messages from console

vijeesh
  • 1,317
  • 1
  • 17
  • 32
-10

If you programmatically create a UIView, there aren't any layout constraints defined. You have to add them manually. If you do have some layoutconstraints configured for a certain view, they can be removed like so:

[view removeConstraints:view.constraints]
Divya Bhaloidiya
  • 5,018
  • 2
  • 25
  • 45
gajchtr
  • 48
  • 5
  • 6
    This doesn't really answer the question. A lot of people use Auto Layout now, and not having constraints is not an option. – TotoroTotoro Oct 03 '14 at 18:36