title: Handling gesture recognizers in iOS6
body: <p>Apparently iOS 6 tries to automatically handle the situation when you have a gesture recognizer and a <code>UIButton</code> in the same place, being activated for the same gesture.</p>
  
  <p>This new automatic handling solves the issue when you want to click the button instead of activating the gesture recognizer, but <strong>creates a new problem</strong> when you want the gesture recognizer to act.</p>
  
  <p>In iOS 5 you could implement:</p>
  
  <pre><code>-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
  </code></pre>
  
  <p>to transfer the action to the <code>UIButton</code> when in a conflict.</p>
  
  <p>This doesn't seem to work in iOS 6. Also, inverting the behavior of this method (because now the <code>UIButton</code> has the priority instead of the gesture recognizer) won't work.</p>
  
  <hr>
  
  <p>Complete method:</p>
  
  <pre><code>- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
      if ([touch.view isKindOfClass:[UIControl class]]){
          return NO;
      }
      return YES;
  }
  </code></pre>