PDA

View Full Version : Monitoring distance finger travels in X or Y direction




RPGamerL99
Nov 9, 2008, 01:00 PM
Is there an easy way for me to see how far the user drags his/her finger on the screen?



jnic
Nov 11, 2008, 07:03 AM
Check out the UITouch docs (https://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITouch_Class/Reference/Reference.html) and the "Touches" code sample (http://developer.apple.com/iphone/library/samplecode/Touches/).

SqueegyX
Nov 11, 2008, 01:45 PM
Basically, you save a CGPoint to an instance variable when touchesBegan, then compare that when touchesMoved