0

Im animating UIImageView with an array of images using method [UIImageView startAnimating]

1.At very start my imageView has an image image1.png.

2.In my image array i have 10 images which start with image1.png and ends with image10.png.

Issue: After completion of animation my imageView's image is image1.png,i want it to be image10.png.

How can i set image10.png as background of imageView on completion of animation?

Wali Haider
  • 1,202
  • 1
  • 16
  • 23

1 Answers1

0

Assign the last object from the array like this.

 animationImageView.image=[images lastObject];
Chan
  • 447
  • 1
  • 5
  • 18
  • set animatedImageView.animationRepeatCount = 0; or to 1 and check. – Chan Aug 06 '14 at 07:31
  • self.aeIcon.animationImages = [NSArray arrayWithObjects:[UIImage imageNamed:@"1.png"],...... [UIImage imageNamed:@"15.png"], nil]; self.aeIcon.animationDuration = 1.0f; self.aeIcon.animationRepeatCount = 1; [self.aeIcon startAnimating]; self.aeIcon.image =[UIImage imageNamed:@"15.png"]; – Wali Haider Aug 06 '14 at 08:42