#1225 - Restoring MapboxGL.h as an Umbrella header file by splitting the singleton code into MGLAccountManager.h and .m
This commit is contained in:
@@ -17,12 +17,13 @@
|
||||
'../platform/darwin/image.mm',
|
||||
'../platform/darwin/reachability.m',
|
||||
'../include/mbgl/ios/MapboxGL.h',
|
||||
'../platform/ios/MapboxGL.m',
|
||||
'../include/mbgl/ios/MGLMapboxEvents.h',
|
||||
'../platform/ios/MGLMapboxEvents.m',
|
||||
'../include/mbgl/ios/MGLMapView.h',
|
||||
'../include/mbgl/ios/MGLMapView+IBAdditions.h',
|
||||
'../platform/ios/MGLMapView.mm',
|
||||
'../include/mbgl/ios/MGLAccountManager.h',
|
||||
'../platform/ios/MGLAccountManager.m',
|
||||
'../include/mbgl/ios/MGLAnnotation.h',
|
||||
'../include/mbgl/ios/MGLUserLocation.h',
|
||||
'../platform/ios/MGLUserLocation_Private.h',
|
||||
|
||||
6
include/mbgl/ios/MGLAccountManager.h
Normal file
6
include/mbgl/ios/MGLAccountManager.h
Normal file
@@ -0,0 +1,6 @@
|
||||
@interface MGLAccountManager : NSObject
|
||||
|
||||
+ (instancetype) sharedInstanceWithAccessToken:(NSString *)token;
|
||||
+ (NSString *) getAccessToken;
|
||||
|
||||
@end
|
||||
@@ -2,10 +2,4 @@
|
||||
#import "MGLMapView.h"
|
||||
#import "MGLTypes.h"
|
||||
#import "MGLUserLocation.h"
|
||||
|
||||
@interface MapboxGL : NSObject
|
||||
|
||||
+ (instancetype) sharedInstanceWithAccessToken:(NSString *)token;
|
||||
+ (NSString *) getAccessToken;
|
||||
|
||||
@end
|
||||
#import "MGLAccountManager.h"
|
||||
@@ -1,6 +1,7 @@
|
||||
#import "MBXAppDelegate.h"
|
||||
#import "MBXViewController.h"
|
||||
#import <mbgl/ios/MapboxGL.h>
|
||||
#import <mbgl/ios/MGLAccountManager.h>
|
||||
#import <mbgl/ios/MGLMapboxEvents.h>
|
||||
|
||||
@implementation MBXAppDelegate
|
||||
@@ -20,7 +21,7 @@
|
||||
}
|
||||
if ( ! accessToken) NSLog(@"No access token set. Mapbox vector tiles won't work.");
|
||||
|
||||
[MapboxGL sharedInstanceWithAccessToken:accessToken];
|
||||
[MGLAccountManager sharedInstanceWithAccessToken:accessToken];
|
||||
|
||||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[MBXViewController new]];
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "MapboxGL.h"
|
||||
#import "MGLAccountManager.h"
|
||||
#import "NSProcessInfo+MGLAdditions.h"
|
||||
#import "MGLMapboxEvents.h"
|
||||
|
||||
@interface MapboxGL()
|
||||
@interface MGLAccountManager()
|
||||
|
||||
@property (atomic) NSString *accessToken;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation MapboxGL
|
||||
@implementation MGLAccountManager
|
||||
|
||||
static MapboxGL *_sharedManager;
|
||||
static MGLAccountManager *_sharedManager;
|
||||
|
||||
// Can be called from any thread. Called implicitly from any
|
||||
// public class convenience methods.
|
||||
@@ -123,7 +123,7 @@ mbgl::DefaultFileSource *mbglFileSource = nullptr;
|
||||
if (self && [self commonInit])
|
||||
{
|
||||
self.styleURL = nil;
|
||||
self.accessToken = [MapboxGL getAccessToken];
|
||||
self.accessToken = [MGLAccountManager getAccessToken];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
Submodule test/ios/KIF updated: ab5a46ff7e...976aafa2e2
Reference in New Issue
Block a user