How would i go about creating an image sequence with core animation. I would like to:
add image1 for 1 second then remove image
add image2 for 2 seconds then remove image
add image1 for 3 seconds then remove
CGImageRef image1 = [self getImage1];
CALayer *image1Layer = [CALayer layer];
image1Layer.bounds = CGRectMake(0, 0, 480, 320);
image1Layer.position = CGPointMake(0, 0);
image1Layer.contents = (id)image1;
CABasicAnimation *animation1 = [CABasicAnimation animationWithKeyPath:@"animation"];
animation1.repeatCount = 0;
animation1.duration = 2.0;
animation1.removedOnCompletion = YES; // i would like to remove image here
animation1.beginTime = AVCoreAnimationBeginTimeAtZero;
[image1Layer addAnimation:animation1 forKey:nil];
The above code adds an image but does not remove it.
Cheers