title: UIGestureRecognizer blocks subview for handling touch events
body: <p>I'm trying to figure out how this is done <em>the right way</em>. I've tried to depict the situation:
  <img src="https://i.stack.imgur.com/CGKo3.png" alt="enter image description here"></p>
  
  <p>I'm adding a <code>UITableView</code> as a subview of a <code>UIView</code>. The <code>UIView</code> responds to a tap- and <code>pinchGestureRecognizer</code>, but when doing so, the tableview stops reacting to those two gestures (it still reacts to swipes).</p>
  
  <p>I've made it work with the following code, but it's obviously not a nice solution and I'm sure there is a better way. This is put in the <code>UIView</code> (the superview):</p>
  
  <pre><code>-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
      if([super hitTest:point withEvent:event] == self) {
          for (id gesture in self.gestureRecognizers) {
              [gesture setEnabled:YES];
          }
          return self;
      }
      for (id gesture in self.gestureRecognizers) {
          [gesture setEnabled:NO];
      }
      return [self.subviews lastObject];
  }
  </code></pre>