summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2018-10-08 11:54:37 -0400
committerJason Wray <friedbunny@users.noreply.github.com>2018-10-09 12:34:58 -0400
commit68e5b66b5d22641f34433ef57c59789278683e95 (patch)
treea29bbfe5aca8420116605c0662f3261773ba9a12
parent558cb9bba6aeea74db2e2372c4f345596469e423 (diff)
downloadqtlocation-mapboxgl-68e5b66b5d22641f34433ef57c59789278683e95.tar.gz
[ios] Add support for Simulator in UIDevice.mgl_isLegacyDevice
-rw-r--r--platform/ios/src/UIDevice+MGLAdditions.m6
1 files changed, 4 insertions, 2 deletions
diff --git a/platform/ios/src/UIDevice+MGLAdditions.m b/platform/ios/src/UIDevice+MGLAdditions.m
index e9da77adda..3522c07401 100644
--- a/platform/ios/src/UIDevice+MGLAdditions.m
+++ b/platform/ios/src/UIDevice+MGLAdditions.m
@@ -4,6 +4,9 @@
@implementation UIDevice (MGLAdditions)
- (NSString *)modelString {
+#if TARGET_OS_SIMULATOR
+ return [[[NSProcessInfo processInfo] environment] objectForKey:@"SIMULATOR_MODEL_IDENTIFIER"];
+#else
char *typeSpecifier = "hw.machine";
size_t size;
@@ -16,6 +19,7 @@
free(answer);
return results;
+#endif
}
- (BOOL)mgl_isLegacyDevice {
@@ -43,8 +47,6 @@
}
}
- // TODO: Also handle simulator using something like `ProcessInfo().environment["SIMULATOR_MODEL_IDENTIFIER"]`.
-
return NO;
}