UIImage Animation

We cannot use gif animation in iOS.
Instead of it, we can use UIImage animation using API.

Prepare multiple images

load-1.png
load-2.png
load-3.png
load-4.png
load- is custom name, you can change name. Important point is number.

API

Use amimatedImageNamed method of UIImage

UIImage *img = [UIImage animatedImageNamed:@"load-" duration:1.0f];
UIImgeView *imgView = [UIImageView alloc] init];
imgView.image = img;

duration is total animation time(s)