Просмотр исходного кода

Add update(priority: ConstraintPriority) method (#467)

* Add update(priority: ConstraintPriority) method

* Fix copy-paste error
Benjamin Chrobot 8 лет назад
Родитель
Сommit
2c8262ef9f
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      Source/Constraint.swift

+ 6 - 0
Source/Constraint.swift

@@ -214,6 +214,12 @@ public final class Constraint {
         return self
     }
 
+    @discardableResult
+    public func update(priority: ConstraintPriority) -> Constraint {
+        self.priority = priority.value
+        return self
+    }
+
     @available(*, deprecated:3.0, message:"Use update(offset: ConstraintOffsetTarget) instead.")
     public func updateOffset(amount: ConstraintOffsetTarget) -> Void { self.update(offset: amount) }