Post

Replies

Boosts

Views

Activity

Reply to MapKit new one handed zoom
It was interfering with a long press gesture that would turn on a selection mode in my app. We the selection mode is on the user taps on items to select. The issue was the first tap gesture would fail. Root cause was the '_MKOneHandedZoomGestureRecognizer' gesture (two days cost to debug.) There is no interface to these MapView gestures so below is a hack work-around (hack meaning it could break in a future iOS release): On the long press gesture set the delegate to object with UIGestureRecognizerDelegate protocols The UIGestureRecognizerDelegate function of interest is: (BOOL) gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { if ([otherGestureRecognizer isKindOfClass:UITapGestureRecognizer.class] || [otherGestureRecognizer isKindOfClass:UIPinchGestureRecognizer.class] || [otherGestureRecognizer isKindOfClass:UIRotationGestureRecognizer.class] || [otherGestureRecognizer isKindOfClass:UISwipeGestureRecognizer.class] || [otherGestureRecognizer isKindOfClass:UIPanGestureRecognizer.class] || [otherGestureRecognizer isKindOfClass:UILongPressGestureRecognizer.class]) { return NO; } else if (otherGestureRecognizer.view.superview == self.mapView && otherGestureRecognizer.state != UIGestureRecognizerStateBegan) { return YES; } else { return NO; } }
May ’22