Is it possible to animate an ordered view when its own content size changes?
For example, imagine that I have an organized view that contains a single UILabel attached to the edges. This label has small text. New text appears that is larger than the previous text. The internal size of the label content is now larger.
I would like to be able to animate it like this:
stackView.layoutIfNeeded() self.label.text = self.expanded ? textTwo : textOne UIView.animateWithDuration(0.3) { () -> Void in self.stackView.layoutIfNeeded() }
The stack currently “skips” from the old content to the new, ignoring the animation block.
An alternative, of course, is to manually find out the height of the organized peep and revive this limitation. I would like to avoid this if possible.
source share