here is the panGesture's instance.
pangstr = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
- (void)handlePan:(UIPanGestureRecognizer *)recognizer{
CGPoint translation = [recognizer translationInView:baseView];
recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x, recognizer.view.center.y);
[recognizer setTranslation:CGPointMake(0, 0) inView:baseView];
if (recognizer.state == UIGestureRecognizerStateEnded) {
CGPoint velocity = [recognizer velocityInView:baseView];
CGFloat magnitude = sqrtf((velocity.x * velocity.x));
CGFloat slideMult = magnitude / 1000;
NSLog(@"magnitude: %f, slideMult: %f", magnitude, slideMult);
float slideFactor = 0.15 * slideMult;
CGPoint finalPoint = CGPointMake(recognizer.view.center.x + (velocity.x * slideFactor),
recognizer.view.center.y + (velocity.y * slideFactor));
}
Now my question is how can i use the (panGestureRecogniser *)recogniser parameter in - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event function. I want this specifically because i wanna get the finalPoint's value in my TouchesMoved function and CGPoint finalPoint uses the *recogniser parameter.
It would be really great if anyone could give me a solution Thanks