This is the setup:
- A UIView created on Interface Builder, linked to an IBOutlet variable (
_vAbout
) - A constraint for this view that we want to animate, linked to an IBOutlet variable (
_ctrBottomAboutView
)
I am using this code to animate:
_ctrBottomAboutView.constant = -100;
[UIView animateWithDuration:0.5 animations:^{
[_vAbout layoutIfNeeded];
}
My problem is: whenever the view has any subviews in it, the animation doesn't work. However, if the view has no children, the animation works correctly.
Do you have any idea of a solution? I have tried everything: adding and removing constraints instead of modificating the constant value, adding constraints to the subviews on Interface Builder...