mirror of https://github.com/SnapKit/SnapKit
Rescope a public install/uninstall
This commit is contained in:
parent
b3740ffb0d
commit
cf977c5a1a
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue