Skip to content

Instantly share code, notes, and snippets.

@mortenjust
Last active November 20, 2015 15:48
Show Gist options
  • Save mortenjust/6518db3be90276bdad51 to your computer and use it in GitHub Desktop.
Save mortenjust/6518db3be90276bdad51 to your computer and use it in GitHub Desktop.
let rotate = CABasicAnimation(keyPath: "transform.rotation")
rotate.fillMode = kCAFillModeForwards
rotate.fromValue = 0.0
rotate.toValue = CGFloat(M_PI * 2.0)
rotate.duration = 1
rotate.repeatCount = Float.infinity
loaderView.layer?.position = CGPointMake(CGRectGetMidX(loaderView.frame), CGRectGetMidY(loaderView.frame))
loaderView.layer?.anchorPoint = CGPointMake(0.5, 0.5)
loaderView.layer?.addAnimation(rotate, forKey: nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment