Skip to content

Instantly share code, notes, and snippets.

@larssondaniel
Created April 2, 2017 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larssondaniel/874c985074fa48b540bced46b6408756 to your computer and use it in GitHub Desktop.
Save larssondaniel/874c985074fa48b540bced46b6408756 to your computer and use it in GitHub Desktop.
- (void)handlePan:(UIPanGestureRecognizer *)recognizer
{
CGPoint translation = [recognizer translationInView:self.view.superview];
if (recognizer.state == UIGestureRecognizerStateBegan)
{
[self panningBegan];
}
if (recognizer.state == UIGestureRecognizerStateEnded)
{
CGPoint velocity = [recognizer velocityInView:self.view];
[self panningEndedWithTranslation:translation velocity:velocity];
}
else
{
CGPoint translation = [recognizer translationInView:self.view.superview];
[self panningChangedWithTranslation:translation];
}
}
@mangerlahn
Copy link

The translation is declared twice, in line 3 and 16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment