views:

26

answers:

1
 [UIView beginAnimations:@"trans" context:nil];
 [UIView setAnimationDelegate:self];
 [UIView setAnimationDidStopSelector:@selector(moveCardToSide)];
 [UIView setAnimationDuration:1.0];

 CGRect frame = playersCard.view.layer.frame;
 frame.origin.x = -30;
 playersCard.view.layer.frame = frame;

 playersCard.view.layer.transform = CATransform3DScale(playersCard.view.layer.transform, 0.7, 0.7, 1.0);
 playersCard.view.layer.transform = CATransform3DRotate(playersCard.view.layer.transform, 30*M_PI/180, 0.0, 1.0, 0.0);

 [UIView commitAnimations];

Both of the above transforms are performed. But only the 2nd once is animated. They both animate if i run them separately. It is possible to combine them into 1 animation? Whats happening with the scale is that it jumps from 100% size to 70% then animates the rotate.

+1  A: 

As you've written it, the transformations are being combined into a single animation. If you want two animations, with the second occurring right after the first simply move your second transform adjustment into an UIView animation block in -moveCardToSide

rpetrich
No they are not combined, or atleast by combined I mean they arent both animated at the same time. What happens is that Scaling is done in 1 Frame(it jumps) then the rotate is performed over a number of frames smoothly animating.
Code
What you seem to be suggesting is that i let the scale animate, then the rotating will animate. What i want to happen is for them both to scale and rotate at the same time.
Code
Why not set it in one go then? `view.layer.transform = CATransform3DRotate(CATransform3DMakeScale(0.7, 0.7, 1.0), 30*M_PI/180, 0.0, 1.0, 0.0);`
rpetrich