In my initial Viewcontroler I have a slide that is loading from the internet and alternating on the screen images at a time stipulated by me.
How can I stop the animation? I wanted to do this before going to another ViewController
Animation:
func animate(images: [String], index: Int = 0) {
print(index)
UIView.transitionWithView(imageView, duration: 10, options: .TransitionCrossDissolve, animations: {
if let checkedUrl = NSURL(string: self.vetString[index]) {
self.downloadImage(checkedUrl)
}
}, completion: { value in
let idx = index == images.count-1 ? 0 : index+1
self.animate(self.vetString, index: idx)
})
}