Animating constraints iOS
Animating constraints iOS
- Subject: Animating constraints iOS
- From: Roland King <email@hidden>
- Date: Mon, 17 Jun 2013 21:12:50 +0800
I'm trying to animate a view growth animation on iOS on a view which uses constraints. My usual way of animating constraint changes on iOS is to set the new ones and then call
[ self layoutIfNeeded ]
inside a UIView transition block. This doesn't work well at all on this particular view, there's a label which changes width and starts being able to lay out content in less lines for a start, that doesn't animate very well, the label works out what the text will look like, and then changes it for the first frame, and that line of text then animates into position as the frame changes. So you get a huge jump. I also really need to delay the animation of one piece of the layout until 1/2 way through because it doesn't look nice.
I re-checked the videos on Auto Layout from 2012 and see that you can make changes to the constant on a constraint (ironic) but the only nice examples are for OSX which uses an animation proxy, there's little or nothing for iOS.
Is there something similar I can use on iOS? It would be fine to be called back from time-to-time and told 'you're 30% through' and then set the constraint constants appropriately, or just be able to say "I want this constraint constant to go from a to b" and let it get on with it actually adjusting the constraints each frame and not just taking the before and after and interpolating between them.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden