I really don't know the animation you're talking about, but if I understand what it does, then one easy way is to use the built-in support UIImageViewto display a series of images as animations. Then you need a separate image for each frame.
NSArray* imageFrames = [NSArray arrayWithObjects:[UIImage imageNamed:@"frame1.png"],
[UIImage imageNamed:@"frame2.png"],
[UIImage imageNamed:@"frame3.png"],
[UIImage imageNamed:@"frame4.png"],
nil];
UIImageView* imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,100,100)];
[imageView setAnimationImages:imageFrames];
[imageView setAnimationDuration:10];
[imageView setAnimationRepeatCount:3];
The above creates UIImageViewwith 4 frames that enliven more than 10 seconds. Animation is repeated 3 times.
See the documentation for more information UIImageView.
Obviously, you really need a series of images for the animation.
source
share