Basically I’m attempting a put your finger on the globe and spin it type function.
So all I really need to do is grab the direction of the swipe and velocity with a short timer (?500ms?)
So something like
While(swiping) {
Get(pointTouched);
swipeDirection = Calc(direction);
swipeSpeed = Calc(speed);
FramesToPlay = swipeSpeed * ConstantAmount;
If(Direction == Backwards){
FramesToPlay = FramesToPlay * -1;
}
Play(playAnimation, FramesToPlay);
wait(500ms);
}
Anyone know anything like this? Or any pieces I can cobble together?
I have the Animation figured out it’s just the details on this swiping that have me a touch confused.
You could probably use a
UIPanGestureRecognizerwhich has avelocityInView:method. I haven’t tested this, but seems like it should work:In addition, when
pan.state == UIGestureRecognizerChanged, you can have your globe turn along with the finger.