If you have some images like this:
let firstImage = UIImage(named: "first")
let secondImage = UIImage(named: "first")
let thirdImage = UIImage(named: "first")
How to display these images on UIImageView and it change image automatically?
Easy, try this:
let imageView = UIImageView()
imageView.animationImages = [firstImage, secondImage, thirdImage]
imageView.startAnimating()
So how to set number of loops?
imageView.animationRepeatCount = 0 // 0 means infinite (default is 0)
Hummm, ok so how to change velocity?
imageView.animationDuration = 0.5 // 0.5 seconds for one cycle of images
Now stop it!
imageView.stopAnimating()
Fun, right?, cheers!