I have a GMSMapView that allows for a handful of gestures inside of it (pan, zoom, etc). I am trying to implement a Facebook style slide out menu from this view. What is the best way to detect a pan gesture from within this view while still allowing for all the other gestures to work properly? I'm sure there is a much better way to do this, but this is what I have so far? Any suggestions?
-(void)didPan:(UIPanGestureRecognizer*)gesture
{
static BOOL g1 = NO;
if(gesture.state == UIGestureRecognizerStateBegan)
{
CGPoint location = [gesture locationInView:self];
if(location.x < 90)
g1 = YES;
}
if(gesture.state == UIGestureRecognizerStateChanged && g1)
{
CGPoint velocity = [gesture velocityInView:self];
if(velocity.x > 0)
{
//Slide out menu
}
else
{
//Normal map view panning, zooming, etc.
}
}
}