I\'m doing this to learn how to work with Core Animation animatable properties on iPhone (not to learn how to crossfade images, per se).
Reading similar questions on
extension UIImageView { func mySetImage(image:UIImage) { guard let currentImage = self.image where currentImage != image else { return } let animation = CATransition() animation.duration = 0.3 animation.type = kCATransitionFade layer.add(animation, forKey: "ImageFade") self.image = image } }