Just started learning iOS AutoLayout, Interface builder very straight forward, but when I try to archive the same thing on the code
[self.view addConstr
The easiest way how to find unsatisfiable constraints:
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
id you can simple tap it in your Find Navigator:HOW TO SIMPLE FIX THAT CASE?
999 for broken constraint.See the related answer here: Unable to simultaneously satisfy constraints, will attempt to recover by breaking constraint