title: Only allowing a single touchesMoved method triggered per period of time?
body: <p>I am using <code>touchesMoved</code> with a coordinate system to detect and respond to user touches within certain areas of the screen. For example, if I have a virtual keyboard and the user swipes across the keys, it reads the coordinates and responds:</p>
  
  <pre><code>- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
  {
      UITouch * touch = [[event allTouches] anyObject];
      CGPoint point = [touch locationInView:touch.view];
      if(point.y &lt; 333 &amp;&amp; point.y &gt; 166 &amp;&amp; point.x &lt; 90 &amp;&amp; point.x &gt; 20)
      {
         //do something
      }
  }
  </code></pre>
  
  <p>...However, the problem is, if the user slowly drags across the keys, or the border between keys, the method is triggered several times in a row, playing the piano key sound in a stutter.</p>
  
  <p>How can I prevent this stutter? I think setting a minimum delay of 0.25 seconds between each successive if statement triggering would help. Also, this delay would only be for a specific if statement -- I want the user to be able to drag across the keys quickly and trigger different key's if-statement as quick as they want.</p>
  
  <p>Does anyone know how to code something like this?</p>