Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[ios] Expose -showAttribution publicly as an IBAction - #10085

Merged
friedbunny merged 2 commits into
masterfrom
fb-showAttribution-public
Oct 2, 2017
Merged

friedbunny merged 2 commits into
masterfrom
fb-showAttribution-public

Conversation

@friedbunny

@friedbunny friedbunny commented Sep 28, 2017 •

Copy link
Copy Markdown
Contributor

Fixes #9024 by exposing -[MGLMapView showAttribution] as an IBAction.

Also removes the deprecated/non-functional style class methods (#8953) from jazzy docs.

Questions

  • Maybe -showAttribution should be split out of the “Configuring the Map’s Appearance” category.
  • Is this enough detail or should it explain more what attribution/telemetry is?

/cc @1ec5 @fabian-guerra

@friedbunny friedbunny added the iOS Mapbox Maps SDK for iOS label Sep 28, 2017
@friedbunny friedbunny added this to the ios-v3.7.0 milestone Sep 28, 2017
@friedbunny friedbunny self-assigned this Sep 28, 2017
@friedbunny

Copy link
Copy Markdown
Contributor Author

screen shot 2017-09-28 at 5 08 50 pm

Comment thread platform/ios/src/MGLMapView.h Outdated
made available so that it can be assigned to custom attribution button
implementations.
*/
- (IBAction)showAttribution;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a valid IBAction signature, but it's customary to add a sender parameter even if we won't use it for anything. (It helps distinguish callers, sort of like the first parameter in a delegate method.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ Agree. The sender parameter will make this clear.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM. → 9d74313

Comment thread platform/ios/src/MGLMapView.h Outdated
*/
- (IBAction)showAttribution;

// Support for style classes has been removed. This property always returns an empty array.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we mark these methods @nodoc to prevent them from counting against our documentation coverage metric?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got this with f8dda96 — jazzy seems fairly particular about requiring the triple-slash, immediately followed by :nodoc:.

Comment thread platform/ios/src/MGLMapView.h Outdated
Show the attribution and telemetry action sheet.

This method is called when the user taps on `attributionButton`. This method is
made available so that it can be assigned to custom attribution button

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: added as an action of custom attribution button implementations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

→ 542d4d8

call `-showAttribution`.

@note The Mapbox terms of service, which governs the use of Mapbox-hosted
vector tiles and styles,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a better place to mention the new action, probably.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new action is equally relevant to both the attribution and telemetry @note sections, though. How about something like:

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 ...

Comment thread platform/ios/src/MGLMapView.h Outdated
made available so that it can be assigned to custom attribution button
implementations.
*/
- (IBAction)showAttribution;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ Agree. The sender parameter will make this clear.

@fabian-guerra fabian-guerra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

Comment thread platform/ios/src/MGLMapView.h Outdated
A view showing legally required copyright notices and telemetry settings,
positioned at the bottom-right of the map view.
positioned at the bottom-right of the map view. Tapping on this button will
call `-showAttribution`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this to -showAttribution:.

Comment thread platform/ios/src/MGLMapView.h Outdated
Show the attribution and telemetry action sheet.

This method is called when the user taps on `attributionButton`. This method is
made available so that it can be added as an action of custom attribution

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: avoid passive voice:

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.

@friedbunny
friedbunny force-pushed the fb-showAttribution-public branch from f8dda96 to 076af14 Compare October 2, 2017 19:40
@friedbunny

Copy link
Copy Markdown
Contributor Author

Rebased, fixed those last little issues, and squashed — will merge this once tests are 🥗.

@friedbunny
friedbunny merged commit 076af14 into master Oct 2, 2017
@friedbunny
friedbunny deleted the fb-showAttribution-public branch October 2, 2017 20:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

iOS Mapbox Maps SDK for iOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants