From c206e9b944931819f016375b6e07fc8806a960ba Mon Sep 17 00:00:00 2001 From: Robert Payne Date: Sat, 11 Feb 2017 22:36:06 +1300 Subject: [PATCH] Add an isActive API to Constraint --- Source/Constraint.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/Constraint.swift b/Source/Constraint.swift index 7656acd..a21343b 100644 --- a/Source/Constraint.swift +++ b/Source/Constraint.swift @@ -47,7 +47,16 @@ public final class Constraint { } } public var layoutConstraints: [LayoutConstraint] - + + public var isActive: Bool { + for layoutConstraint in self.layoutConstraints { + if layoutConstraint.isActive { + return true + } + } + return false + } + // MARK: Initialization internal init(from: ConstraintItem,