summaryrefslogtreecommitdiff
path: root/platform/ios/src
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/src')
-rw-r--r--platform/ios/src/MGLMapView.h12
-rw-r--r--platform/ios/src/MGLMapView.mm4
2 files changed, 14 insertions, 2 deletions
diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h
index 528606fd4e..06d958185e 100644
--- a/platform/ios/src/MGLMapView.h
+++ b/platform/ios/src/MGLMapView.h
@@ -253,6 +253,9 @@ MGL_EXPORT IB_DESIGNABLE
A view showing legally required copyright notices and telemetry settings,
positioned at the bottom-right of the map view.
+ If you choose to reimplement this view, assign the `-showAttribution:` method
+ as the action for your view to present the default notices and settings.
+
@note The Mapbox terms of service, which governs the use of Mapbox-hosted
vector tiles and styles,
<a href="https://www.mapbox.com/help/attribution/">requires</a> these
@@ -272,6 +275,15 @@ MGL_EXPORT IB_DESIGNABLE
@property (nonatomic, readonly) UIButton *attributionButton;
/**
+ Show the attribution and telemetry action sheet.
+
+ This action is performed when the user taps on the attribution button provided
+ by default via the `attributionButton` property. If you implement a custom
+ attribution button, you should add this action to the button.
+ */
+- (IBAction)showAttribution:(id)sender;
+
+/**
Support for style classes has been removed. This property always returns an empty array.
*/
@property (nonatomic) NS_ARRAY_OF(NSString *) *styleClasses __attribute__((deprecated("This property is non-functional.")));
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 006792f4bf..3288a93ab4 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -503,7 +503,7 @@ public:
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
if ([_attributionButton respondsToSelector:@selector(accessibilityIgnoresInvertColors)]) { _attributionButton.accessibilityIgnoresInvertColors = YES; }
#endif
- [_attributionButton addTarget:self action:@selector(showAttribution) forControlEvents:UIControlEventTouchUpInside];
+ [_attributionButton addTarget:self action:@selector(showAttribution:) forControlEvents:UIControlEventTouchUpInside];
_attributionButton.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_attributionButton];
_attributionButtonConstraints = [NSMutableArray array];
@@ -2025,7 +2025,7 @@ public:
#pragma mark - Attribution -
-- (void)showAttribution
+- (void)showAttribution:(__unused id)sender
{
NSString *title = NSLocalizedStringWithDefaultValue(@"SDK_NAME", nil, nil, @"Mapbox iOS SDK", @"Action sheet title");
UIAlertController *attributionController = [UIAlertController alertControllerWithTitle:title