У меня есть массив больших изображений (4000x4000) и больше, и я зацикливаюсь на этих изображениях во время анимации.
Цель здесь - сжать эти изображения перед загрузкой, но независимо от того, какое расширение я использую, вызов self.theImage.animationImages
не работает.
Вот мой код:
let images = [
#imageLiteral(resourceName: "imageOne"),
#imageLiteral(resourceName: "imageTwo"),
#imageLiteral(resourceName: "imageThree"),
#imageLiteral(resourceName: "imageFour"),
#imageLiteral(resourceName: "ImageFive"),
#imageLiteral(resourceName: "imageSix")]
self.theImage.animationImages = images;
self.theImage.animationDuration = 10.0
self.theImage.layer.add(rotatePicture, forKey: nil)
self.theImage.startAnimating()
UIView.animate(withDuration: 1, animations:{
self.theImage.frame.origin.y += 440
}){_ in
UIView.animateKeyframes(withDuration: 1, delay: 2.25, options: [.autoreverse, .repeat], animations: {
self.theImage.frame.origin.y -= 490
})
}
}