Question : rotate image animated swift
Answered by : mysterious-mongoose-5zhxil3wabew
extension UIView{ func rotate() { let rotation : CABasicAnimation = CABasicAnimation(keyPath: "transform.rotation.z") rotation.toValue = NSNumber(value: Double.pi * 2) rotation.duration = 1 rotation.isCumulative = true rotation.repeatCount = Float.greatestFiniteMagnitude self.layer.add(rotation, forKey: "rotationAnimation") }
}
Source : https://stackoverflow.com/questions/31478630/animate-rotation-uiimageview-in-swift | Last Update : Thu, 16 Jul 20