Makmeksum
Makmeksum

Reputation: 463

Xcode turn off auto layout related warning in console outputs

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?

Upvotes: 21

Views: 4546

Answers (3)

Adam Bardon
Adam Bardon

Reputation: 3889

Swift 4:

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

Upvotes: 13

vijeesh
vijeesh

Reputation: 1327

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

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

Upvotes: 9

gajchtr
gajchtr

Reputation: 48

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]

Upvotes: -10

Related Questions