Skip to content

Instantly share code, notes, and snippets.

@congnd
Created January 4, 2021 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save congnd/2318242508fdc300f97cf69384aa3159 to your computer and use it in GitHub Desktop.
Save congnd/2318242508fdc300f97cf69384aa3159 to your computer and use it in GitHub Desktop.
let animation = CABasicAnimation(keyPath: #keyPath(CALayer.transform))
let angle = CGFloat.random(in: ) * CGFloat.pi
let rotation = CATransform3DMakeRotation(angle, 0, 1, 0)
let finalScale = CGFloat.random(in: 2…5)
let transoform = CATransform3DScale(rotation, finalScale, finalScale, 1)
animation.toValue = transoform
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment