0

I'm trying to recognize an UIPanGestureRecognizer from display bottom edge, from my experience it could be easy just asking if the difference from x is too near from the bottom edge but when I'm debugging I have a lot of results with the locationInView gesture coordinate which aren't useful to me.

I've been doing tests and when I pass my finger very fast from bottom edge I have coordinates with more than 50 points of difference, how can I know what is the best way to get this result?

specktro
  • 295
  • 1
  • 5
  • 12

1 Answers1

2

You can use UIGestureRecognizerDelegate.

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
    CGPoint location = [touch locationInView:gestureRecognizer];
    if(location_is_in_the_area_that_you_want)
         return TRUE;

    return FALSE;
}

Hope this helps. Cheers!

George
  • 4,029
  • 1
  • 23
  • 31