summaryrefslogtreecommitdiff
path: root/platform/ios/MGLMapboxEvents.m
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/MGLMapboxEvents.m')
-rw-r--r--platform/ios/MGLMapboxEvents.m24
1 files changed, 14 insertions, 10 deletions
diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m
index 1db0f9e9f6..d21a723d94 100644
--- a/platform/ios/MGLMapboxEvents.m
+++ b/platform/ios/MGLMapboxEvents.m
@@ -6,6 +6,7 @@
#import <CoreTelephony/CTCarrier.h>
#import "MGLMetricsLocationManager.h"
+#import "NSProcessInfo+MGLAdditions.h"
#include <sys/sysctl.h>
@@ -176,17 +177,20 @@ NSString *const MGLEventGestureRotateStart = @"Rotation";
static dispatch_once_t onceToken;
static MGLMapboxEvents *_sharedManager;
dispatch_once(&onceToken, ^{
- void (^setupBlock)() = ^{
- _sharedManager = [[self alloc] init];
- // setup dedicated location manager on first use
- [MGLMetricsLocationManager sharedManager];
- };
- if ( ! [[NSThread currentThread] isMainThread]) {
- dispatch_sync(dispatch_get_main_queue(), ^{
+ if ( ! NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent) {
+ void (^setupBlock)() = ^{
+ _sharedManager = [[self alloc] init];
+ // setup dedicated location manager on first use
+ [MGLMetricsLocationManager sharedManager];
+ };
+ if ( ! [[NSThread currentThread] isMainThread]) {
+ dispatch_sync(dispatch_get_main_queue(), ^{
+ setupBlock();
+ });
+ }
+ else {
setupBlock();
- });
- } else {
- setupBlock();
+ }
}
});
return _sharedManager;