Hello and sorry for posting here, but I can't find any other information about this.
I want to animate the height of a UIView to 0.0 and update the constrains at the same time. How would I do that?
Thanks in advance.
@netgfx
Something like:
box.snp_makeConstraints { make in
make.left.equalTo(50)
}
…
UIView.animateWithDuration(5.0) {
box.snp_updateConstraints { make in
make.left.equalTo(50)
}
box.superview.layoutIfNeeded()
}
You may need to remakeConstraints
rather than updateConstraints
if you're not altering _just_ the constant value.
Thanks that worked.
superview.layoutIfNeeded() did the trick
Most helpful comment
@netgfx
Something like:
You may need to
remakeConstraints
rather thanupdateConstraints
if you're not altering _just_ the constant value.