The UIImageView
class provides the easiest way for developers to implement animations. All you need to do is to create an UIImageView
object with a series of images for animating.
Example
// Load images
NSArray *imageNames = @[@"win_1.png", @"win_2.png", @"win_3.png"];
NSMutableArray *images = [[NSMutableArray alloc] init];
for (int i = 0; i < imageNames.count; i++) {
[images addObject:[UIImage imageNamed:[imageNames objectAtIndex:i]]];
}
// Normal Animation
UIImageView *animationImageView = [[UIImageView alloc] initWithFrame:CGRectMake(60, 95, 86, 193)];
animationImageView.animationImages = images;
animationImageView.animationDuration = 0.5;
[self.view addSubview:animationImageView];
[animationImageView startAnimating];