diff --git a/Source/Constraint.swift b/Source/Constraint.swift index b93a8d9..7324c59 100644 --- a/Source/Constraint.swift +++ b/Source/Constraint.swift @@ -228,7 +228,17 @@ public class Constraint { for layoutConstraint in self.layoutConstraints { let attribute = (layoutConstraint.secondAttribute == .notAnAttribute) ? layoutConstraint.firstAttribute : layoutConstraint.secondAttribute layoutConstraint.constant = self.constant.constraintConstantTargetValueFor(layoutAttribute: attribute) - layoutConstraint.priority = self.priority.constraintPriorityTargetValue + + #if os(iOS) || os(tvOS) + let requiredPriority: UILayoutPriority = UILayoutPriorityRequired + #else + let requiredPriority: Float = 1000.0 + #endif + + + if (layoutConstraint.priority < requiredPriority), (self.priority.constraintPriorityTargetValue != requiredPriority) { + layoutConstraint.priority = self.priority.constraintPriorityTargetValue + } } }