-
-
Save tbatsuur/69f0b2215485b0dcf228f69bd8f56a19 to your computer and use it in GitHub Desktop.
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
func moveYellow() { | |
self.yellowView.layer.cornerRadius = self.yellowView.frame.width/2 | |
self.yellowView.clipsToBounds = true | |
let circlePath = UIBezierPath(arcCenter: CGPoint(x: DeviceScreen.main.centreX ,y: DeviceScreen.main.centreY), radius: 100.0, startAngle: CGFloat(0), endAngle:CGFloat(Double.pi * 2), clockwise: true) | |
let animation = CAKeyframeAnimation(keyPath: #keyPath(CALayer.position)) | |
animation.duration = 5.0 | |
animation.repeatCount = MAXFLOAT | |
animation.path = circlePath.cgPath | |
self.yellowView.layer.add(animation, forKey: nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment