mirror of https://github.com/SnapKit/SnapKit
Further tweaks and improvements
This commit is contained in:
parent
62c0318c00
commit
ebe9bb1e8d
|
@ -89,11 +89,7 @@ final public class ConstraintMaker {
|
||||||
let maker = ConstraintMaker(view: view)
|
let maker = ConstraintMaker(view: view)
|
||||||
block(make: maker)
|
block(make: maker)
|
||||||
|
|
||||||
var layoutConstraints = [LayoutConstraint](view.snp_installedLayoutConstraints)
|
self.removeConstraints(view)
|
||||||
for existingLayoutConstraint in layoutConstraints {
|
|
||||||
existingLayoutConstraint.snp_constraint?.uninstallFromView()
|
|
||||||
}
|
|
||||||
|
|
||||||
for constraint in maker.constraints {
|
for constraint in maker.constraints {
|
||||||
constraint.installOnView(updateExisting: false)
|
constraint.installOnView(updateExisting: false)
|
||||||
}
|
}
|
||||||
|
@ -114,8 +110,7 @@ final public class ConstraintMaker {
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class func removeConstraints(view: View) {
|
internal class func removeConstraints(view: View) {
|
||||||
let existingLayoutConstraints = [LayoutConstraint](view.snp_installedLayoutConstraints)
|
for existingLayoutConstraint in view.snp_installedLayoutConstraints {
|
||||||
for existingLayoutConstraint in existingLayoutConstraints {
|
|
||||||
existingLayoutConstraint.snp_constraint?.uninstallFromView()
|
existingLayoutConstraint.snp_constraint?.uninstallFromView()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue