I need to create a looping animation like this GIF:
I’ve one image, these is clouds. I need to see an animation of looping clouds once I launch the app. I am including 2 imageView
with the identical cloud image. I exploit this code to do that:
cloudsImageView1.body.origin.x = 0
cloudsImageView2.body.origin.x = screenSize
UIView.animate(withDuration: 20.0, delay: 0.0, choices: [.repeat, .curveLinear], animations: {
self.cloudsImageView1.body = self.cloudsImageView1.body.offsetBy(dx: -1 * screenSize, dy: 0.0)
self.cloudsImageView2.body = self.cloudsImageView2.body.offsetBy(dx: -1 * screenSize, dy: 0.0)
}, completion: nil)
However I’ve dangerous outcomes with fallacious route and disappearing photographs. How one can repair it?