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

[ios] Fix iOS 8 incompatibility in scale bar RTL check #10241

Merged
merged 2 commits into from
Oct 20, 2017

Conversation

friedbunny
Copy link
Contributor

@friedbunny friedbunny commented Oct 19, 2017

Fixes #10225 by checking to see if UIView.semanticContentAttribute is available before using it in -[MGLScaleBar usesRightToLeftLayout]. This now falls back to UIApplication.userInterfaceLayoutDirection in iOS 8.

Also fixes an issue in iosapp where -[UIFont monospacedDigitSystemFontOfSize:weight:] wasn’t available in iOS 8.

simulator screen shot - iphone 6 - 2017-10-19 at 11 39 30

/cc @frederoni @fabian-guerra

@friedbunny friedbunny added crash iOS Mapbox Maps SDK for iOS labels Oct 19, 2017
@friedbunny friedbunny added this to the ios-v3.7.0 milestone Oct 19, 2017
@friedbunny friedbunny self-assigned this Oct 19, 2017
@@ -165,7 +165,9 @@ - (void)viewDidLoad
self.mapView.scaleBar.hidden = NO;
self.mapView.showsUserHeadingIndicator = YES;
self.hudLabel.hidden = YES;
self.hudLabel.titleLabel.font = [UIFont monospacedDigitSystemFontOfSize:10 weight:UIFontWeightRegular];
if ([UIFont respondsToSelector:@selector(monospacedDigitSystemFontOfSize:weight:)]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

For iOS 8 which would be the font alternative?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It’s set to use the system font of the same size, via the storyboard.

Copy link
Contributor

@fabian-guerra fabian-guerra left a comment

Choose a reason for hiding this comment

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

👍🏼

@friedbunny friedbunny force-pushed the fb-scalebar-ios8-fix branch from 8217e31 to 00e44e9 Compare October 20, 2017 21:05
@friedbunny friedbunny merged commit 00e44e9 into release-agua Oct 20, 2017
@friedbunny friedbunny deleted the fb-scalebar-ios8-fix branch October 20, 2017 21:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
crash iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants