animatedImageWithImages :duration:
Creates and returns an animated image from an existing set of images.
+ (UIImage *)animatedImageWithImages:(NSArray *)images duration:(NSTimeInterval)duration
Parameters
- images
- An array of
UIImage
objects. - duration
- The duration of the animation.
Return Value of [UIImage animatedImageWithImages]
A new image object.
Discussion of [UIImage animatedImageWithImages]
All images included in the animated image should share the same size and scale.
Example of [UIImage animatedImageWithImages]
- (void) viewDidLoad {
[super viewDidLoad];
UIImage *imgBG = [UIImage imageNamed:@"logo.png"];
UIImage *imgSC = [UIImage imageNamed:@"sourceControl.png"];
imgBG = [UIImage [UIImage animatedImageWithImages:[NSArray arrayWithObjects:imgBG, imgSC, nil] duration:1.0f];
...
}