diff options
Diffstat (limited to 'platform/ios/MapboxGL.m')
-rw-r--r-- | platform/ios/MapboxGL.m | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/platform/ios/MapboxGL.m b/platform/ios/MapboxGL.m index b1cb44cbc9..97ac8f1d5d 100644 --- a/platform/ios/MapboxGL.m +++ b/platform/ios/MapboxGL.m @@ -1,22 +1,24 @@ #import <Foundation/Foundation.h> #import "MapboxGL.h" +#import "NSProcessInfo+MGLAdditions.h" @interface MapboxGL() +@property (atomic) NSString *accessToken; + @end -@property (atomic) NSString *accessToken; @implementation MapboxGL +static MapboxGL *_sharedManager; // Can be called from any thread. Called implicitly from any // public class convenience methods. // -+ (instancetype) sharedInstanceWithAccessToken:(NSString *)token { ++ (id) sharedInstanceWithAccessToken:(NSString *)token { static dispatch_once_t onceToken; - static MapboxGL *_sharedManager; dispatch_once(&onceToken, ^{ if ( ! NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent) { void (^setupBlock)() = ^{ @@ -36,4 +38,11 @@ return _sharedManager; } ++ (NSString *) getAccessToken { + if (_sharedManager) { + return _sharedManager.accessToken; + } + return nil; +} + @end
\ No newline at end of file |