Last active
April 18, 2019 19:31
-
-
Save 4np/1226771ab0f060583aac0ac9ba8352f5 to your computer and use it in GitHub Desktop.
Disable noisy layout constraint warnings that clutter up the Xcode console.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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