From cf977c5a1a624c5f433132bcd4f344497eb1db9b Mon Sep 17 00:00:00 2001 From: Robert Payne Date: Wed, 14 Jan 2015 14:07:28 +1300 Subject: [PATCH] Rescope a public install/uninstall --- Snap/Constraint.swift | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Snap/Constraint.swift b/Snap/Constraint.swift index 03d519b..dd7f0cf 100644 --- a/Snap/Constraint.swift +++ b/Snap/Constraint.swift @@ -268,10 +268,20 @@ public class Constraint { self.offset = amount return self } + + // MARK: install / uninstall + + public func install() -> Array { + return self.installOnView(updateExisting: false) + } + + public func uninstall() { + self.uninstallFromView() + } // MARK: internal - internal func install(updateExisting: Bool = false) -> Array { + internal func installOnView(updateExisting: Bool = false) -> Array { if self.installedOnView != nil { NSException(name: "Cannot Install Constraint", reason: "Already installed", userInfo: nil).raise() return [] @@ -377,7 +387,7 @@ public class Constraint { return layoutConstraints } - internal func uninstall() { + internal func uninstallFromView() { if let view = self.installedOnView { #if os(iOS) var installedConstraints = view.constraints()