title: Pan gesture interferes with scroll
body: <p>I have three view controllers that are part of a UIScrollView. I want to be able to swipe between the three, although one of the view controllers has a UIPanGestureRecognizer. I use this pan gesture recognizer to allow the user to drag their finger up and down to increase and decrease the height of a rectangular UIView. Therefore, this UIPanGestureRecognizer only really needs to know about the upwards/downwards panning, and the scroll view can use the horizontal panning. </p>
  
  <p>An example of this, is like the home screen; you can swipe left or right, but also swipe down to get spotlight. I want this kind of mechanism.</p>
  
  <p>This is my code for the pan:</p>
  
  <pre><code>- (void)pan:(UIPanGestureRecognizer *)aPan; // When pan guesture is recognised
  {
  CGPoint location = [aPan locationInView:self.view]; // Location of finger on screen
  CGRect secondRect = CGRectMake(210.0, 45.0, 70.0, 325.0); // Rectangles of maximimum bar area
  CGRect minuteRect = CGRectMake(125.0, 45.0, 70.0, 325.0);
  CGRect hourRect = CGRectMake(41.0, 45.0, 70.0, 325.0);
  
  if (CGRectContainsPoint(secondRect, location)) { // If finger is inside the 'second' rectangle
  
      CGPoint currentPoint = [aPan locationInView:self.view];
  
      currentPoint.y -= 80;  // Make sure animation doesn't go outside the bars' rectangle
  
      if (currentPoint.y &lt; 0) {
      currentPoint.y = 0;
      }
      else if (currentPoint.y &gt; 239) {
      currentPoint.y = 239;
      }
  
      currentPoint.y = 239.0 - currentPoint.y;
  
      CGFloat pointy = currentPoint.y - fmod(currentPoint.y, 4.0);
  
      [UIView animateWithDuration:0.01f  // Animate the bars to rise as the finger moves up and down
                       animations:^{
                           CGRect oldFrame = secondBar.frame;
                           secondBar.frame = CGRectMake(oldFrame.origin.x, (oldFrame.origin.y - (pointy - secondBar.frame.size.height)), oldFrame.size.width, (pointy));
                       }];
  
      CGFloat result = secondBar.frame.size.height - fmod(secondBar.frame.size.height, 4.0);
  
      secondInt = (result / 4.0); // Update labels with new time
  
      self-&gt;secondLabel.text = [NSString stringWithFormat:@"%02d", secondInt];
  }
  </code></pre>
  
  <p>The code is basically repeated for three separate rectangular UIViews.</p>
  
  <p>If anyone can tell me how to get the homescreen-style panning/swiping into my app, that would be great!!</p>