Rescope a public install/uninstall

This commit is contained in:
Robert Payne 2015-01-14 14:07:28 +13:00
parent b3740ffb0d
commit cf977c5a1a
1 changed files with 12 additions and 2 deletions

View File

@ -269,9 +269,19 @@ public class Constraint {
return self
}
// MARK: install / uninstall
public func install() -> Array<LayoutConstraint> {
return self.installOnView(updateExisting: false)
}
public func uninstall() {
self.uninstallFromView()
}
// MARK: internal
internal func install(updateExisting: Bool = false) -> Array<LayoutConstraint> {
internal func installOnView(updateExisting: Bool = false) -> Array<LayoutConstraint> {
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()