I've have a bunch of .png files that i am supposed to animate over a period of 1.05 seconds. After the animation executes, i would like to have the last .png file show up permanently. I am using an UIIMageview IBOutlet to hold the animation. However, after the animation executes, the image just disappears and i do not see anything in on the screen.
The code for the animation is as follows:
-(void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self loadArrayForTickAnimation];
});
if (tickArray) {
self.animationView.animationImages = tickArray;
self.animationView.animationDuration = 1.05;
self.animationView.animationRepeatCount = 1;
[self.animationView startAnimating];
[self performSelector:@selector(showFinalImage) withObject:nil afterDelay:1.2];
}
}
- (void)showFinalImage
{
[self.animationView setImage:[UIImage imageNamed:@"check_37.png"]];
}
Here, check_1.png to check_37.png are the files that needed to be animated. I store them in an array called "tickArray", and populate the array using the [self loadArrayForTickAnimation] message.And finally, i have to set the UIIMage for the animationView as check_37.png