Disable autolayout constraint error messages in debug console output in Xcode

前端 未结 5 1573
清酒与你
清酒与你 2020-12-04 07:07

Is there a way to (temporarily) disable autolayout error/warning messages:

Unable to simultaneously satisfy constraints.
    Probably at least one of the con         


        
5条回答
  •  不思量自难忘°
    2020-12-04 07:24

    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.

提交回复
热议问题