I added a CATransform3DMakeRotation to a layer. When I add another one it deletes the old one?
The first one:
[UIView beginAnimations:@"rotaty" context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationDelegate:self];
CGAffineTransform transform = CGAffineTransformMakeRotation(-3.14);
kuvert.transform = CGAffineTransformRotate(transform, DegreesToRadians(134));
kuvert.center = CGPointMake(kuvert.center.x-70, kuvert.center.y+100);
[UIView commitAnimations];
and the second one:
CABasicAnimation *topAnim = [CABasicAnimation animationWithKeyPath:@"transform"];
topAnim.duration=1;
topAnim.repeatCount=0;
topAnim.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(0.0, 0, 0, 0)];
float f = DegreesToRadians(180); // -M_PI/1;
topAnim.toValue=[NSValue valueWithCATransform3D:CATransform3DMakeRotation(f, 0,1, 0)];
topAnim.delegate = self;
topAnim.removedOnCompletion = NO;
topAnim.fillMode = kCAFillModeBoth;
[topAnim setValue:@"flippy" forKey:@"AnimationName"];
[[KuvertLasche layer] addAnimation:topAnim forKey:@"flippy"];
The second one resets the view and applies itself after that. How do I fix this??