Is it possible to animate an arranged subview when its intrinsic content size changes?
For example, imagine I have an arranged subview, which holds a single UILabel pinned to edges. That label has a small amount of text. New text comes in, which is larger than the previous text. The intrinsic content size of label is now larger.
I would like to be able to animate it like so:
stackView.layoutIfNeeded()
self.label.text = self.expanded ? textTwo : textOne
UIView.animateWithDuration(0.3) { () -> Void in
self.stackView.layoutIfNeeded()
}
The stackview currently "jumps" from the old content size to the new one, ignoring the animation block.
An alternative of course is to manually find out the height of the arranged subview, and animate that constraint. I'd like to avoid that if possible.