Question

i have a problem with the UIPanGestureRecognizer behavior.

All works great unless I slide in from the top of my iPad. Top means here the side where the camera is located, no matter how the current device orientation is.

With the following code i debug the UIPanGestureRecognizer behavior:

- (void)viewDidLoad
{
    [super viewDidLoad];
    _pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGesture:)];
    [self.view addGestureRecognizer:_pan];
}


- (void)panGesture:(UIPanGestureRecognizer*)gesture
{
    if (gesture.state == UIGestureRecognizerStateBegan) {
        NSLog(@"BEGIN");
    } else {
        NSLog(@"GO");
    }
}

So when i slide in from the top nothing happens.

It seems that iOS would catch that gesture, perhaps it is related to the notification center?

In principle it seems possible to get that gesture because i saw this on other apps.

What am I missing here?

Was it helpful?

Solution

Apple says in their transition guide that the existence of the notification center means that your touches at the very bottom and very top of the screen may be canceled. I think this is likely an example of that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top