title: UITapGestureRecognizer on UILabels in subview of UIScrollView not working
body: <p>I have a problem where my UITapGestureRecognizer on my UILabels in a content view in my UIScrollView is not calling it's methods.</p>
  
  <p>The view hierarchy is as follows:</p>
  
  <ul>
  <li>scrollView (UIScrollView)  
  
  <ul>
  <li>contentView (UIView)  
  
  <ul>
  <li>testLabel (UILabel) - here is where the UITapGestureRecognizer is attached</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>I have distilled the code down to an example to highlight the problem</p>
  
  <pre><code>// Set scrollview size - Added in Storyboad
  [scrollView setContentSize:CGSizeMake([arrayOfVerbs count]*self.view.frame.size.width, scrollView.contentSize.height)];
  [scrollView setCanCancelContentTouches:YES]; // Tried both yes and no
  [scrollView setPagingEnabled:YES];
  
  // Add content view
  UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, scrollView.contentSize.width, scrollView.contentSize.height)];
  [scrollView addSubview:contentView];
  
  // Add test UILabel
  UILabel *testLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 100)];
  [testLabel setBackgroundColor:[UIColor redColor]];
  [testLabel setText:@"Test touch"];
  [testLabel setUserInteractionEnabled:YES];
  [contentView addSubview:testLabel];
  
  // Add gesture recogniser
  UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(playSound:)];
  singleTap.numberOfTapsRequired = 1;
  [testLabel addGestureRecognizer:singleTap];
  </code></pre>
  
  <p>And this is the method that the tap gesture recogniser should call</p>
  
  <pre><code>- (void)playSound:(UITapGestureRecognizer *)sender {
  
      NSLog(@"play sound");
  
      if(sender.state == UIGestureRecognizerStateEnded)
      {
          int pronounNumber = [sender.view tag];
          int exampleNumber = (int)sender.view.frame.origin.x%(int)self.view.frame.size.width;
  
          NSLog(@"Pronoun is %i and example is %i", pronounNumber, exampleNumber);
      }
  }
  </code></pre>
  
  <p>This method is never called when I tried to touch on the UILabel.</p>
  
  <p>I have tried setting the property canCancelContentTouches to both YES and NO on the scroll view as suggested by this <a href="https://stackoverflow.com/questions/10286938/trouble-with-gesture-recognizers-in-subviews">thread</a>, but it's still not working.</p>
  
  <p>The strange thing is, if I add a UILabel outside of the scrollView, then the gesture recogniser works! So the problem only occurs in my contentView which is a subview of my scrollView.</p>
  
  <p>I am using auto-layout, if that might be any difference?</p>
  
  <p>Thanks!</p>