Can someone explain how this IOS Pan Gesture Recognition works? [on hold]
- by user79894
It is ios app using Pan Gesture Recognizer
It works great, but I didn't get it. I wanna do some changes if the dragged UIView reaches a specific position it would call another method. Any comments are appreciated.
- (IBAction)handlePan1:(UIPanGestureRecognizer *)recognizer {
CGPoint translation = [recognizer translationInView:self.view];
recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x, recognizer.view.center.y + translation.y);
[recognizer setTranslation:CGPointMake(0, 0) inView:self.view];
/*
[x1 setText:[NSString stringWithFormat: @"%.2f", recognizer.view.center.x]];
[y1 setText:[NSString stringWithFormat: @"%.2f", recognizer.view.center.y]];
[x2 setText:[NSString stringWithFormat: @"%.2f", translation.x]];
[y2 setText:[NSString stringWithFormat: @"%.2f", translation.y]];*/
}