Setting animationImages
does not support an additional fade-in/fade-out effect when transitioning between images.
What you can do is creating a CAKeyframeAnimation
and provide it with the array of images you are trying to animate, e.g.:
NSArray* contents = <NSArray of UIImages>;
CAKeyframeAnimation* animation = [CAKeyframeAnimation animationWithKeyPath:@"contents"];
[animation setCalculationMode:kCAAnimationLinear];
[animation setDuration:contentsAnimationDuration];
[animation setRepeatCount:HUGE_VALF];
[animation setValues:contents];
[self.layer addAnimation:animation forKey:@"contents"];
In order to use Core Animation, you have to link the Quartz framework and include the relevant header file.
You could also you a category on CALayer I wrote for this purpose.