Last active
November 6, 2021 06:51
-
-
Save dimkagithub/59b2c7fd343713fd8f184c6795c37266 to your computer and use it in GitHub Desktop.
UIIMageView Extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIImageView { | |
func rotate() { | |
let rotation : CABasicAnimation = CABasicAnimation(keyPath: "transform.rotation.x") | |
rotation.toValue = NSNumber(value: Double.pi * 2) | |
rotation.duration = 2 | |
rotation.isCumulative = true | |
rotation.repeatCount = Float.greatestFiniteMagnitude | |
self.layer.add(rotation, forKey: "rotationAnimation") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment