开发者

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:

  1. Get the time when a touch Began and ended. (and swipe)
  2. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜