From e8ea669ca5f236c83dde87c4f494f796319539cc Mon Sep 17 00:00:00 2001 From: Keita Watanabe Date: Tue, 17 Aug 2021 20:23:25 +0900 Subject: [PATCH] add extension for constraint --- TinyConstraints/Classes/Constraints.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/TinyConstraints/Classes/Constraints.swift b/TinyConstraints/Classes/Constraints.swift index d56a9a4..95bd4e5 100644 --- a/TinyConstraints/Classes/Constraints.swift +++ b/TinyConstraints/Classes/Constraints.swift @@ -37,6 +37,16 @@ public enum ConstraintRelation: Int { case equalOrGreater = 1 } +public extension Constraint { + func activate() { + Constraint.activate([self]) + } + + func deActivate() { + Constraint.deactivate([self]) + } +} + public extension Collection where Iterator.Element == Constraint { func activate() {