From bc845b96b0d945cc0feea9177017d661f56a5f06 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Wed, 27 Jul 2016 23:32:21 -0700 Subject: [ios] Limit annotation view pan gesture check to own recognizer (#5813) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows non-dragging pans that are initiated on views to pan the underlying map. Annotation views each have long press and pan gesture recognizers. If a view is not draggable or not in a positive dragging state, the pan gesture recognizer should not begin. This commit makes the criteria for rejecting pans more strict — only `_panGestureRecognizer` should be rejected, not the entire `UIPanGestureRecognizer` class. --- platform/ios/CHANGELOG.md | 1 + platform/ios/src/MGLAnnotationView.mm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index e55624f8bb..e3f259ddf1 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -5,6 +5,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CON ## 3.3.2 * Fixed a crash that occurred when initializing an MGLMapView on iOS 8.1 or below. ([#5791](https://github.com/mapbox/mapbox-gl-native/pull/5791)) +* Fixed an issue where pan gestures that originated on view annotations would not pan the underlying map. ([#5813](https://github.com/mapbox/mapbox-gl-native/pull/5813)) ## 3.3.1 diff --git a/platform/ios/src/MGLAnnotationView.mm b/platform/ios/src/MGLAnnotationView.mm index f8591f036b..7064ccbd76 100644 --- a/platform/ios/src/MGLAnnotationView.mm +++ b/platform/ios/src/MGLAnnotationView.mm @@ -235,7 +235,7 @@ { BOOL isDragging = self.dragState == MGLAnnotationViewDragStateDragging; - if ([gestureRecognizer isKindOfClass:UIPanGestureRecognizer.class] && !(isDragging)) + if (gestureRecognizer == _panGestureRecognizer && !(isDragging)) { return NO; } -- cgit v1.2.1