summaryrefslogtreecommitdiff
path: root/platform/ios/src/MGLScaleBar.mm
diff options
context:
space:
mode:
authorjmkiley <jordan.kiley@mapbox.com>2018-09-11 18:25:32 -0700
committerjmkiley <jordan.kiley@mapbox.com>2018-09-11 18:25:32 -0700
commit381d8b46997ca8b9000b29dba38e0de206856ccb (patch)
treecdd47319c1af67be2cecd042bb98d4aca1b76c51 /platform/ios/src/MGLScaleBar.mm
parent1efec00dc959ee5606ff4db06f7c4e1cd48a5c39 (diff)
downloadqtlocation-mapboxgl-381d8b46997ca8b9000b29dba38e0de206856ccb.tar.gz
[ios, macos] started to restore iOS 8 supportupstream/ios8-release-frappe
Diffstat (limited to 'platform/ios/src/MGLScaleBar.mm')
-rw-r--r--platform/ios/src/MGLScaleBar.mm6
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/ios/src/MGLScaleBar.mm b/platform/ios/src/MGLScaleBar.mm
index d69fb3e852..a180280adc 100644
--- a/platform/ios/src/MGLScaleBar.mm
+++ b/platform/ios/src/MGLScaleBar.mm
@@ -205,7 +205,11 @@ static const CGFloat MGLFeetPerMeter = 3.28084;
#pragma mark - Convenience methods
- (BOOL)usesRightToLeftLayout {
- return [UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.superview.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft;
+ if ([self.superview respondsToSelector:@selector(semanticContentAttribute)]) {
+ return [UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.superview.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft;
+ } else {
+ return UIApplication.sharedApplication.userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft;
+ }
}
- (BOOL)usesMetricSystem {