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

[ios] Long-press attribution button to show SDK version #10650

Merged
merged 3 commits into from
Dec 8, 2017

Conversation

friedbunny
Copy link
Contributor

Fixes #6551. Long-press on the attribution button to show the SDK release version in the title of the attribution action sheet. This provides a convenient, one-step method to determine what version of our SDK an app is running (without resorting to digging through its bundle).

German localization.

/cc @1ec5 @fabian-guerra @akitchen

@friedbunny friedbunny added the iOS Mapbox Maps SDK for iOS label Dec 6, 2017
@friedbunny friedbunny self-assigned this Dec 6, 2017

if (shouldShowVersion)
{
attributionController.title = [title stringByAppendingFormat:@" %@", [NSBundle mgl_frameworkInfoDictionary][@"MGLSemanticVersionString"]];
Copy link
Contributor

Choose a reason for hiding this comment

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

No localized format string? 😉

{
BOOL shouldShowVersion = [sender isKindOfClass:[UILongPressGestureRecognizer class]];
Copy link
Contributor

Choose a reason for hiding this comment

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

For what it’s worth, it’s pretty unlikely that a developer implementing a custom ℹ️ button will hook up a long press gesture recognizer to this method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is here because I reused the existing showAttribution: method for the long press gesture recognizer target, so this is where we determine what the user did to trigger the attribution sheet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, hrm — is your point that we may lose this functionality when developers roll their own? That is true, which means that maybe we should also implement one of your suggestions in #6551 (comment).

Copy link
Contributor Author

@friedbunny friedbunny Dec 7, 2017

Choose a reason for hiding this comment

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

b51250464a475fb2294d8e1d8b9171e66aace40a b99b866

@friedbunny friedbunny force-pushed the fb-attribution-sheet-version-6551 branch 2 times, most recently from b512504 to b99b866 Compare December 7, 2017 20:33
@friedbunny friedbunny added the macOS Mapbox Maps SDK for macOS label Dec 7, 2017
@friedbunny friedbunny force-pushed the fb-attribution-sheet-version-6551 branch from a2da237 to 4f31b07 Compare December 8, 2017 00:01
@friedbunny friedbunny merged commit 4f31b07 into master Dec 8, 2017
@friedbunny friedbunny added this to the ios-v4.0.0 milestone Dec 8, 2017
@friedbunny friedbunny deleted the fb-attribution-sheet-version-6551 branch December 8, 2017 01:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants