From b3ea068e5db3147dda87a1f39a0391807ff9ff25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Wed, 8 Jul 2015 12:41:34 -0700 Subject: [PATCH 1/2] Assert if -mapView:symbolNameForAnnotation: is implemented Fixes #1851. --- platform/ios/MGLMapView.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index d6500889f..32ba5a03c 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -455,6 +455,14 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) if (_delegate == delegate) return; _delegate = delegate; + + if ([delegate respondsToSelector:@selector(mapView:symbolNameForAnnotation:)]) + { + [NSException raise:@"Method unavailable" format: + @"-mapView:symbolNameForAnnotation: has been removed from the MGLMapViewDelegate protocol, but %@ still implements it. " + @"Implement -[%@ mapView:imageForAnnotation:] instead.", + NSStringFromClass([delegate class]), NSStringFromClass([delegate class])]; + } } #pragma mark - Layout - From 8a971458a4dc3590a215d460eb99f6de79cf06fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Wed, 8 Jul 2015 13:13:32 -0700 Subject: [PATCH 2/2] Removed documentation for unavailable method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So it doesn’t show up in the generated docset. --- include/mbgl/ios/MGLMapView.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h index 900728034..4b21d5bad 100644 --- a/include/mbgl/ios/MGLMapView.h +++ b/include/mbgl/ios/MGLMapView.h @@ -345,10 +345,6 @@ IB_DESIGNABLE /** @name Managing the Display of Annotations */ -/** Returns the style's symbol name to use for the marker for the specified point annotation object. -* @param mapView The map view that requested the annotation symbol name. -* @param annotation The object representing the annotation that is about to be displayed. -* @return The marker symbol to display for the specified annotation or `nil` if you want to display the default symbol. */ - (nullable NSString *)mapView:(MGLMapView *)mapView symbolNameForAnnotation:(id )annotation __attribute__((unavailable("Use -mapView:imageForAnnotation:."))); /** Returns an image object to use for the marker for the specified point annotation object.