How would I start creating a sequence of images using basic animation. I would like to:
add image1 for 1 second and then delete image
add image2 for 2 seconds and then delete image
add image1 for 3 seconds then delete
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;
The above code adds an image but does not delete it.
Greetings
source share