Getting the speed of a screen swipe

Discussion in 'iOS Programming' started by drf1229, Feb 9, 2010.

  1. drf1229 macrumors regular

    drf1229

    Joined:
    Jun 22, 2009
    #1
    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!
     
  2. ChOas macrumors regular

    Joined:
    Nov 24, 2006
    Location:
    The Netherlands
    #2
    Take the distance the touch moved in a certain interval. The further the distance traveled the faster the swipe.
     
  3. drf1229 thread starter macrumors regular

    drf1229

    Joined:
    Jun 22, 2009

Share This Page