Applying speed and number of rotations for CABasicAnimation
I am trying to mimic the rotation of the bottle in Spin the Coke app and pie-chart in the Roambie App. . I wanted to rotate a view as per the touches and swipes of the user on that view.
What I currently do it:
- Get the time when a touch Began and ended. (and swipe)
- G开发者_如何学编程et all the coordinates of the touch or swipe and find the total distance.
I believe that the spin the coke app animates the bottles based on the distance and time taken for the swipe or touch. But I am not sure how they could have done.
I wanted the view to rotate faster initially, then slowdown and stop finally.
Please share your thoughts on how this problem could be solved?
Take a look at keyframe animation: you have to build your animation manually but you can achieve any result you want.
精彩评论