I am animating a UIImage with this code
CABasicAnimation *animation; animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"]; animation.duration = 1; animation.toValue = [NSNumber numberWithFloat:M_PI]; animation.fromValue = [NSNumber numberWithInt:0]; [square.layer addAnimation:animation forKey:@"rotation"];
Everything works fine, but my array takes its original position at the end of the animation. I looked at the properties of the layer and found:
[square.layer setTransform:CATransform3DRotate(HERE, -M_PI, 0, 0, 0)]
And I do not know what to write instead of "HERE". Could you help me please? Many thanks!
iphone core-animation
Pierre
source share