0

I'm making a game where the player throws a cube. I have 6 images that correspond to each cube, and I want to have shuffle effect like it's randomly choosing between 1-6. How can this be done?

kernix
  • 7,970
  • 3
  • 28
  • 44

1 Answers1

1

Take a look at this post: Is it possible to animate an UIImage?

All you need to do is stop the animation when you have selected the random image.

As @kernix said in the comment, to stop the animation after it has animated once, all you need to do is set the repeat count to 1.

imageView.animationRepeatCount = 1

In order to have a callback method called after the animation, please see the following post: Access Method After UIImageView Animation Finish

Community
  • 1
  • 1
max_
  • 24,076
  • 39
  • 122
  • 211