0

I have been searching for the whole internet about how to make a Spinning animation with facebook POP animation.

With no luck that kPOPLayerRotation only supports "Flip X/Y" animation, but not "Spin" (like the rotate property in front-end CSS), can anybody know how to do this?

Dicky Tsang
  • 6,135
  • 4
  • 20
  • 18

1 Answers1

0

Try this:

Objective-C

POPSpringAnimation *rotateAnimation = [POPSpringAnimation animation];
rotateAnimation.property = [POPAnimatableProperty propertyWithName: kPOPLayerRotation];
rotateAnimation.toValue= @(M_PI/4); 

Swift

let rotateAnimation = POPSpringAnimation(propertyName: kPOPLayerRotation)
rotateAnimation?.toValue = Double.pi / 4
MGY
  • 7,245
  • 5
  • 41
  • 74
  • Hi, lots of posts from the internet told me so, but I got this result, it is so weird. PS. I am using swift, and this is the code. https://cloud.githubusercontent.com/assets/4535844/26634426/38f724c4-4649-11e7-9a6d-8e89c7de10bb.png https://cloud.githubusercontent.com/assets/4535844/26634425/38f4d25a-4649-11e7-9443-0967ea38fc53.gif – Dicky Tsang May 31 '17 at 13:37