Authored by janardan

Update -[MASViewConstraint layoutConstraintSimilarTo:] to check relation (and fix spelling).

@@ -295,7 +295,7 @@ static char kInstalledConstraintsKey; @@ -295,7 +295,7 @@ static char kInstalledConstraintsKey;
295 295
296 MASLayoutConstraint *existingConstraint = nil; 296 MASLayoutConstraint *existingConstraint = nil;
297 if (self.updateExisting) { 297 if (self.updateExisting) {
298 - existingConstraint = [self layoutConstraintSimiliarTo:layoutConstraint]; 298 + existingConstraint = [self layoutConstraintSimilarTo:layoutConstraint];
299 } 299 }
300 if (existingConstraint) { 300 if (existingConstraint) {
301 // just update the constant 301 // just update the constant
@@ -309,7 +309,7 @@ static char kInstalledConstraintsKey; @@ -309,7 +309,7 @@ static char kInstalledConstraintsKey;
309 [firstLayoutItem.mas_installedConstraints addObject:self]; 309 [firstLayoutItem.mas_installedConstraints addObject:self];
310 } 310 }
311 311
312 -- (MASLayoutConstraint *)layoutConstraintSimiliarTo:(MASLayoutConstraint *)layoutConstraint { 312 +- (MASLayoutConstraint *)layoutConstraintSimilarTo:(MASLayoutConstraint *)layoutConstraint {
313 // check if any constraints are the same apart from the only mutable property constant 313 // check if any constraints are the same apart from the only mutable property constant
314 314
315 // go through constraints in reverse as we do not want to match auto-resizing or interface builder constraints 315 // go through constraints in reverse as we do not want to match auto-resizing or interface builder constraints
@@ -320,6 +320,7 @@ static char kInstalledConstraintsKey; @@ -320,6 +320,7 @@ static char kInstalledConstraintsKey;
320 if (existingConstraint.secondItem != layoutConstraint.secondItem) continue; 320 if (existingConstraint.secondItem != layoutConstraint.secondItem) continue;
321 if (existingConstraint.firstAttribute != layoutConstraint.firstAttribute) continue; 321 if (existingConstraint.firstAttribute != layoutConstraint.firstAttribute) continue;
322 if (existingConstraint.secondAttribute != layoutConstraint.secondAttribute) continue; 322 if (existingConstraint.secondAttribute != layoutConstraint.secondAttribute) continue;
  323 + if (existingConstraint.relation != layoutConstraint.relation) continue;
323 if (existingConstraint.multiplier != layoutConstraint.multiplier) continue; 324 if (existingConstraint.multiplier != layoutConstraint.multiplier) continue;
324 if (existingConstraint.priority != layoutConstraint.priority) continue; 325 if (existingConstraint.priority != layoutConstraint.priority) continue;
325 326