From 2e225939621733359e3254b00b5853afa650f4fd Mon Sep 17 00:00:00 2001 From: Julian Rex Date: Thu, 19 Apr 2018 15:47:58 -0400 Subject: [ios] Mark -presentCalloutFromRect:inView:constrainedToView:animated: unavailable (#11738) --- platform/ios/CHANGELOG.md | 1 + platform/ios/app/MBXCustomCalloutView.m | 5 ----- platform/ios/src/MGLCalloutView.h | 2 +- platform/ios/test/MGLAnnotationViewTests.m | 2 -- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 1a82a27e12..7064d183c8 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -52,6 +52,7 @@ The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iO * The `MGLMapView.selectedAnnotations` property (backed by `-[MGLMapView setSelectedAnnotations:]`) now selects annotations that are off-screen. ([#9790](https://github.com/mapbox/mapbox-gl-native/issues/9790)) * The `animated` parameter to `-[MGLMapView selectAnnotation:animated:]` now controls whether the annotation and its callout are brought on-screen. If `animated` is `NO` then the annotation is selected if offscreen, but the map is not panned. Currently only point annotations are supported. Setting the `MGLMapView.selectedAnnotations` property now animates. ([#3249](https://github.com/mapbox/mapbox-gl-native/issues/3249)) * Fixed a crash when rapidly adding and removing annotations. ([#11551](https://github.com/mapbox/mapbox-gl-native/issues/11551), [#11575](https://github.com/mapbox/mapbox-gl-native/issues/11575)) +* Marked protocol method `-[MGLCalloutView presentCalloutFromRect:inView:constrainedToView:animated:]` as unavailable. Use `-[MGLCalloutView presentCalloutFromRect:inView:constrainedToRect:animated:]` instead. ([#11738](https://github.com/mapbox/mapbox-gl-native/pull/11738)) ### Map snapshots diff --git a/platform/ios/app/MBXCustomCalloutView.m b/platform/ios/app/MBXCustomCalloutView.m index 0626b0997a..2d70e8b7b3 100644 --- a/platform/ios/app/MBXCustomCalloutView.m +++ b/platform/ios/app/MBXCustomCalloutView.m @@ -39,11 +39,6 @@ static CGFloat const tipWidth = 10.0; #pragma mark - API -- (void)presentCalloutFromRect:(CGRect)rect inView:(UIView *)view constrainedToView:(UIView *)constrainedView animated:(BOOL)animated -{ - [self presentCalloutFromRect:rect inView:view constrainedToRect:CGRectNull animated:animated]; -} - - (void)presentCalloutFromRect:(CGRect)rect inView:(nonnull UIView *)view constrainedToRect:(__unused CGRect)constrainedRect animated:(BOOL)animated { if ([self.delegate respondsToSelector:@selector(calloutViewWillAppear:)]) diff --git a/platform/ios/src/MGLCalloutView.h b/platform/ios/src/MGLCalloutView.h index 7e7cf2d02e..689b159fd7 100644 --- a/platform/ios/src/MGLCalloutView.h +++ b/platform/ios/src/MGLCalloutView.h @@ -39,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN Presents a callout view by adding it to `view` and pointing at the given rect of `view`’s bounds. Constrains the callout to the bounds of the given view. */ -- (void)presentCalloutFromRect:(CGRect)rect inView:(UIView *)view constrainedToView:(UIView *)constrainedView animated:(BOOL)animated; +- (void)presentCalloutFromRect:(CGRect)rect inView:(UIView *)view constrainedToView:(UIView *)constrainedView animated:(BOOL)animated __attribute__((unavailable("Use -presentCalloutFromRect:inView:constrainedToRect:animated: instead."))); /** diff --git a/platform/ios/test/MGLAnnotationViewTests.m b/platform/ios/test/MGLAnnotationViewTests.m index c8b140b274..2f5963e66e 100644 --- a/platform/ios/test/MGLAnnotationViewTests.m +++ b/platform/ios/test/MGLAnnotationViewTests.m @@ -49,8 +49,6 @@ static NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReu _didCallDismissCalloutAnimated = YES; } -- (void)presentCalloutFromRect:(CGRect)rect inView:(UIView *)view constrainedToView:(UIView *)constrainedView animated:(BOOL)animated { } - - (void)presentCalloutFromRect:(CGRect)rect inView:(nonnull UIView *)view constrainedToRect:(CGRect)constrainedRect animated:(BOOL)animated {} @end -- cgit v1.2.1