I'm working though some animation for a project, and it's becoming a little complicated.
I'm using the Core Animation methods on UIView, and it seems like its hard to set up an animation that fires in "stages". Please help me if I'm wrong about this.
Right now, my code looks like:
But this doesn't feel like the cleanest way to do things. I thought about using the animation delegate to manually fire the appropriate animation after the previous animation completed, but this sounds like it might not be the best solution, either.
Any ideas?
I'm using the Core Animation methods on UIView, and it seems like its hard to set up an animation that fires in "stages". Please help me if I'm wrong about this.
Right now, my code looks like:
Code:
const CGFloat animationDuration = 1.0;
[UIView beginAnimations: nil context: nil];
[UIView setAnimationDelay: (animationDuration * 0)];
[UIView setAnimationDuration: animationDuration];
// Run first animation
[UIView beginAnimations: nil context: nil];
[UIView setAnimationDelay: (animationDuration * 1)];
[UIView setAnimationDuration: animationDuration];
// Run second animation
[UIView beginAnimations: nil context: nil];
[UIView setAnimationDelay: (animationDuration * 2)];
[UIView setAnimationDuration: animationDuration];
// Run third animation
[UIView commitAnimations];
[UIView commitAnimations];
[UIView commitAnimations];
But this doesn't feel like the cleanest way to do things. I thought about using the animation delegate to manually fire the appropriate animation after the previous animation completed, but this sounds like it might not be the best solution, either.
Any ideas?