Created
September 10, 2012 13:43
-
-
Save sebk/3691003 to your computer and use it in GitHub Desktop.
UIPanGestureRecognizer - determine direction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGPoint velocity = [gestureRecognizer velocityInView:currentView]; | |
if (velocity.x * lastGestureVelocity.x + velocity.y * lastGestureVelocity.y > 0) { | |
//NSLog(@"gesture went in same direction"); | |
} | |
else { | |
NSLog(@"gesture went in opposite direction"); | |
} | |
lastGestureVelocity = velocity; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment