I’m using a UIPanGesture to return velocityInView and from what I gather it’s supposed to be returning points per second. What I am getting is numbers in the hundreds of millions and a lot of zeros… I’m not moving my mouse that quickly in the simulator.
I think…
Thanks in advance for any help/advice you have.
Edit: Requested Code.
Displaying / Calling
-(void)handlePanGesture:(UIPanGestureRecognizer *) recognizer
{
if (recognizer.state == UIGestureRecognizerStateChanged ||
recognizer.state == UIGestureRecognizerStateBegan)
{
CGPoint vel = [recognizer velocityInView:myScrollView];
//[self doSpinAnimationWithVelocity:vel.x];
NSLog([NSString stringWithFormat:@"Velocity - X-Axis - %d ", vel.x]);
NSLog([NSString stringWithFormat:@"Velocity - Y-Axis - %d ", vel.y]);
}
}
without your code its hard to say…
CGPoint is made up of CGFloats, depending on how you are printing them you could be getting unexpected results
The view you pass into velocityInView: must be in the view hierarchy, check it by looking at the window property on the view before you pass it into the velocityInView: method