Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why would I use an CAAnimationGroup?

I have trouble understanding apple's core animation (for iOS). I am trying to animate the position and bounds of a layer concurrently (but with different timing functions).

According to the documentation, a CAAnimationGroup allows multiple animations to be grouped and run concurrently. But according to my (early) experiments this can also be accomplished by adding several animation objects to the target layer. If so, what is the purpose of that CAAnimationGroup?

like image 302
ragnarius Avatar asked May 28 '11 17:05

ragnarius


1 Answers

If you want to animate two different properties with different timing functions then grouping these animation is not needed in this case. I think that grouping is useful when you create several animations and want them to have the same timing behaviour. You can set timing function for the group. In the Core Animation Cookbook i saw an example that shows how to use grouping when setting a timing curve for CAKeyframeAnimation.

like image 149
danny_23 Avatar answered Sep 19 '22 05:09

danny_23