El gesto de panorámica interfiere con el desplazamiento

Tengo tres controladores de vista que forman parte de un UIScrollView. Quiero poder deslizar entre los tres, aunque uno de los controladores de vista tiene un UIPanGestureRecognizer. Utilizo este reconocedor de gestos de pan para permitir al usuario arrastrar su dedo hacia arriba y hacia abajo para aumentar y disminuir la altura de una vista de planta rectangular. Por lo tanto, este UIPanGestureRecognizer solo necesita conocer el panorama hacia arriba / hacia abajo, y la vista de desplazamiento puede usar el desplazamiento horizontal.

Un ejemplo de esto, es como la pantalla de inicio; puede deslizar hacia la izquierda o hacia la derecha, pero también deslizar hacia abajo para obtener un foco. Quiero este tipo de mecanismo.

Este es mi código para la sartén:

- (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 < 0) {
    currentPoint.y = 0;
    }
    else if (currentPoint.y > 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->secondLabel.text = [NSString stringWithFormat:@"%02d", secondInt];
}

El código se repite básicamente para tres UIViews rectangulares separadas.

¡Si alguien me puede decir cómo hacer que la aplicación de pantalla panorámica se deslice / deslice en mi aplicación, sería genial!

Respuestas a la pregunta(1)

Su respuesta a la pregunta