I'm not sure I fully understand what strokes you need to detect or why / how you need to detect them. However, I had a similar issue detecting user gestures gestures on top of the GMSMapView due to touchhesbegan: only called once.
I had my own button “Current Location”, which allows the user to switch the centering of the map by their location on / off. I needed to find out when the user “pans” the map without interrupting the reception of the panning map (I still wanted the map to also be paned).
First I created a map:
Then I created a gesture recognizer and added it to theMapView gesture recognition attribute. I set the goal self using the didPan: selector didPan:
// Watch for pan UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget: self action:@selector(didPan:)]; theMapView.gestureRecognizers = @[panRecognizer];
Finally, in the same main file, I applied the didPan: method to respond when the user clicks:
- (void) didPan:(UIPanGestureRecognizer*) gestureRecognizer { NSLog(@"DID PAN");
Charlie j
source share