Disable autolayout constraint error messages in debug console output in Xcode

Did some decompiling and there’s actually a way:

for Swift 5

UserDefaults.standard.set(false, forKey: "_UIConstraintBasedLayoutLogUnsatisfiable")

Objective-C

[[NSUserDefaults standardUserDefaults] setValue:@(NO) forKey:@"_UIConstraintBasedLayoutLogUnsatisfiable"];

Now you’ll only get notified that “_UIConstraintBasedLayoutLogUnsatisfiable is OFF”.

Obligatory reminder for anyone reading this: this should be last resort, for tips on debugging and fixing constraint issues see WWDC’s “Mysteries of Auto Layout” sessions: part 1 and part 2.

Leave a Comment