Skip to content

Commit

Permalink
Rescope a public install/uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
robertjpayne committed Jan 14, 2015
1 parent b3740ff commit cf977c5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Snap/Constraint.swift
Expand Up @@ -268,10 +268,20 @@ public class Constraint {
self.offset = amount
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 []
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit cf977c5

Please sign in to comment.