Moved removeConstraints method into the ConstraintMaker proxy.

This commit is contained in:
Noon, Christian 2014-12-30 15:47:31 -08:00
parent a634c61942
commit d0dc521429
2 changed files with 8 additions and 5 deletions

View File

@ -97,4 +97,11 @@ public class ConstraintMaker {
} }
LayoutConstraint.setLayoutConstraints(layoutConstraints, installedOnView: view) LayoutConstraint.setLayoutConstraints(layoutConstraints, installedOnView: view)
} }
internal class func removeConstraints(view: View) {
for existingLayoutConstraint in LayoutConstraint.layoutConstraintsInstalledOnView(view) {
existingLayoutConstraint.constraint?.uninstall()
}
LayoutConstraint.setLayoutConstraints([], installedOnView: view)
}
} }

View File

@ -55,10 +55,6 @@ public extension View {
} }
public func snp_removeConstraints() { public func snp_removeConstraints() {
for existingLayoutConstraint in LayoutConstraint.layoutConstraintsInstalledOnView(self) { ConstraintMaker.removeConstraints(self)
existingLayoutConstraint.constraint?.uninstall()
}
LayoutConstraint.setLayoutConstraints([], installedOnView: self)
} }
} }