Below is the code that automatically transitions between different images, every 5 seconds. I want to add animations to the transitions i.e. fade, scroll from left, etc. How would I go about doing this in Swift? Thanks.
class ViewController: UIViewController {
@IBOutlet weak var imageView: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
imageView.animationImages = [
UIImage(named: "brooklyn-bridge.jpg")!,
UIImage(named: "grand-central-terminal.jpg")!,
UIImage(named: "new-york-city.jpg")!,
UIImage(named: "one-world-trade-center.jpg")!,
UIImage(named: "rain.jpg")!,
UIImage(named: "wall-street.jpg")!]
imageView.animationDuration = 25.0
imageView.startAnimating()
}
Here is a standalone class you can use to animate image change with fade animation.
animating code, based on this answer, in Swift 3
Implement it as a custom image view would be better.