Hi i'm creating a Keyframe animation from multiple images. My problem is i would like the animation to instantly change from one image to the next rather than a fade.
CALayer *animLayer = [CALayer layer];
animLayer.bounds = CGRectMake(0, 0, width, height);
animLayer.position = CGPointMake(0, 0);
CAKeyframeAnimation *customFrameAnimation = [CAKeyframeAnimation animationWithKeyPath:@"contents"];
NSArray *sizeValues = [NSArray arrayWithObjects:(id)image1, (id)image2, nil];
NSArray *times = [NSArray arrayWithObjects:[NSNumber numberWithFloat:0.0f], [NSNumber numberWithFloat:0.5f], nil];
NSArray *timingFunctions = [NSArray arrayWithObjects: [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault], [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault], nil];
[customFrameAnimation setValues:sizeValues];
[customFrameAnimation setKeyTimes:times];
customFrameAnimation.duration=5.0;
customFrameAnimation.beginTime = 1e-100;
customFrameAnimation.fillMode = kCAFillModeRemoved;
customFrameAnimation.timingFunctions = timingFunctions;
customFrameAnimation.removedOnCompletion = YES;
[animLayer addAnimation:customFrameAnimation forKey:nil];
Thanks in advance.