How can I have one CABasicAnimation to run after the other one has finishes? In other words sequentially. I've added the begin time of the second animation, however it seems that the second animation doesn't gets executed:
CABasicAnimation * appearance =[CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
appearance.duration = 0.5;
appearance.fromValue = [NSNumber numberWithFloat:0];
appearance.toValue = [NSNumber numberWithFloat:340];
appearance.repeatCount = 1;
appearance.fillMode = kCAFillModeForwards;
appearance.removedOnCompletion = NO;
[notif.layer addAnimation:appearance forKey:@"transform.translation.y"];
CABasicAnimation * theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
theAnimation.duration = 0.5;
theAnimation.fromValue = [NSNumber numberWithFloat:0];
theAnimation.toValue = [NSNumber numberWithFloat:10];
theAnimation.repeatCount = 3;
theAnimation.autoreverses = YES;
theAnimation.fillMode = kCAFillModeForwards;
theAnimation.removedOnCompletion = NO;
theAnimation.beginTime = appearance.beginTime + appearance.duration;
[notif.layer addAnimation:theAnimation forKey:@"transform.translation.y"];
Any idea why?