The easiest way how to find unsatisfiable constraints:
- set unique identifier for every constraint in your view:
- create simple extension for
NSLayoutConstraint
:
SWIFT:
extension NSLayoutConstraint {
override public var description: String {
let id = identifier ?? ""
return "id: \(id), constant: \(constant)" //you may print whatever you want here
}
}
OBJECTIVE-C
@interface NSLayoutConstraint (Description)
@end
@implementation NSLayoutConstraint (Description)
-(NSString *)description {
return [NSString stringWithFormat:@"id: %@, constant: %f", self.identifier, self.constant];
}
@end
- build it once again, and now you have more readable output for you:
- once you got your
id
you can simple tap it in your Find Navigator:
- and quickly find it:
HOW TO SIMPLE FIX THAT CASE?
- try to change priority to
999
for broken constraint.
See the related answer here: Unable to simultaneously satisfy constraints, will attempt to recover by breaking constraint