Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

drf1229

macrumors regular
Original poster
Jun 22, 2009
237
0
I was working on an app where a person can throw an object based on the speed of a swipe on the screen. I've tried creating a variable that grows each time the touchesMoved method is called, but touchesMoved is called more times if the swipe is slower and less times if the swipe is quicker. Is there any other way to tell the speed of a swipe on the screen? Any advice is greatly appreciated!
 

ChOas

macrumors regular
Nov 24, 2006
139
0
The Netherlands
I was working on an app where a person can throw an object based on the speed of a swipe on the screen. I've tried creating a variable that grows each time the touchesMoved method is called, but touchesMoved is called more times if the swipe is slower and less times if the swipe is quicker. Is there any other way to tell the speed of a swipe on the screen? Any advice is greatly appreciated!

Take the distance the touch moved in a certain interval. The further the distance traveled the faster the swipe.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.