Skip to content

Instantly share code, notes, and snippets.

@4np
Last active April 18, 2019 19:31
Show Gist options
  • Save 4np/1226771ab0f060583aac0ac9ba8352f5 to your computer and use it in GitHub Desktop.
Save 4np/1226771ab0f060583aac0ac9ba8352f5 to your computer and use it in GitHub Desktop.
Disable noisy layout constraint warnings that clutter up the Xcode console.
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
...
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
...
// Disable the NSLayoutConstraint warnings thast are cluttering
// up the debug console.
disableNoisyLayoutConstraintWarnings()
}
#warning("Temporarily disable noisy layout constraint warnings; these should still be fixed though!")
private func disableNoisyLayoutConstraintWarnings() {
// Disable NSLayoutConstraints warnings to clean up debug console.
// TODO: We need to fix these, but right now these are cluttering up the debug console.
UserDefaults.standard.setValue(false, forKey: "_UIConstraintBasedLayoutLogUnsatisfiable")
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment