diff options
author | Jesse Bounds <jesse@rebounds.net> | 2018-01-08 16:29:57 -0800 |
---|---|---|
committer | Fabian Guerra <fabian.guerra@mapbox.com> | 2018-02-19 16:08:18 -0500 |
commit | e6520d75960778c34f67a94ed392633a5fd172e1 (patch) | |
tree | ff5f9f5581822deb7d98599bb300439b574a02ee | |
parent | 6fccfe354845fea5f49a1c3b8108972f71a74508 (diff) | |
download | qtlocation-mapboxgl-e6520d75960778c34f67a94ed392633a5fd172e1.tar.gz |
Guard against creating events for IB
-rw-r--r-- | platform/ios/src/MGLMapboxEvents.m | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/ios/src/MGLMapboxEvents.m b/platform/ios/src/MGLMapboxEvents.m index e22484ec7d..59eb070449 100644 --- a/platform/ios/src/MGLMapboxEvents.m +++ b/platform/ios/src/MGLMapboxEvents.m @@ -1,5 +1,6 @@ #import "MGLMapboxEvents.h" #import "NSBundle+MGLAdditions.h" +#import "NSProcessInfo+MGLAdditions.h" static NSString * const MGLAPIClientUserAgentBase = @"MapboxEventsiOS"; @@ -24,6 +25,10 @@ static NSString * const MGLAPIClientUserAgentBase = @"MapboxEventsiOS"; } + (nullable instancetype)sharedInstance { + if (NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent) { + return nil; + } + static dispatch_once_t onceToken; static MGLMapboxEvents *_sharedInstance; dispatch_once(&onceToken, ^{ |