diff options
author | Brad Leege <bleege@gmail.com> | 2015-05-04 16:13:18 -0500 |
---|---|---|
committer | Brad Leege <bleege@gmail.com> | 2015-05-04 16:13:18 -0500 |
commit | 0e36bf1c8d620b55db1171a1575350e7e4ac699f (patch) | |
tree | 85882a9d1a8e619c28e7415066b2c8b47751b4c3 | |
parent | f96046103f3800b95e80753f4b63435d4946fcd0 (diff) | |
download | qtlocation-mapboxgl-0e36bf1c8d620b55db1171a1575350e7e4ac699f.tar.gz |
#1225 - Restoring MapboxGL.h as an Umbrella header file by splitting the singleton code into MGLAccountManager.h and .m
-rw-r--r-- | gyp/platform-ios.gypi | 3 | ||||
-rw-r--r-- | include/mbgl/ios/MGLAccountManager.h | 6 | ||||
-rw-r--r-- | include/mbgl/ios/MapboxGL.h | 8 | ||||
-rw-r--r-- | ios/app/MBXAppDelegate.m | 3 | ||||
-rw-r--r-- | platform/ios/MGLAccountManager.m (renamed from platform/ios/MapboxGL.m) | 8 | ||||
-rw-r--r-- | platform/ios/MGLMapView.mm | 2 | ||||
m--------- | test/ios/KIF | 0 |
7 files changed, 16 insertions, 14 deletions
diff --git a/gyp/platform-ios.gypi b/gyp/platform-ios.gypi index 142896c4ee..305fd5284d 100644 --- a/gyp/platform-ios.gypi +++ b/gyp/platform-ios.gypi @@ -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', diff --git a/include/mbgl/ios/MGLAccountManager.h b/include/mbgl/ios/MGLAccountManager.h new file mode 100644 index 0000000000..aed2536a34 --- /dev/null +++ b/include/mbgl/ios/MGLAccountManager.h @@ -0,0 +1,6 @@ +@interface MGLAccountManager : NSObject + ++ (instancetype) sharedInstanceWithAccessToken:(NSString *)token; ++ (NSString *) getAccessToken; + +@end
\ No newline at end of file diff --git a/include/mbgl/ios/MapboxGL.h b/include/mbgl/ios/MapboxGL.h index 8470591d5d..34e080a511 100644 --- a/include/mbgl/ios/MapboxGL.h +++ b/include/mbgl/ios/MapboxGL.h @@ -2,10 +2,4 @@ #import "MGLMapView.h" #import "MGLTypes.h" #import "MGLUserLocation.h" - -@interface MapboxGL : NSObject - -+ (instancetype) sharedInstanceWithAccessToken:(NSString *)token; -+ (NSString *) getAccessToken; - -@end
\ No newline at end of file +#import "MGLAccountManager.h"
\ No newline at end of file diff --git a/ios/app/MBXAppDelegate.m b/ios/app/MBXAppDelegate.m index 4d314483ae..0a81e83fb8 100644 --- a/ios/app/MBXAppDelegate.m +++ b/ios/app/MBXAppDelegate.m @@ -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]]; diff --git a/platform/ios/MapboxGL.m b/platform/ios/MGLAccountManager.m index 7c542cb363..d408ba8d49 100644 --- a/platform/ios/MapboxGL.m +++ b/platform/ios/MGLAccountManager.m @@ -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. diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index e48b3d82dc..b915fa01f9 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -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; } diff --git a/test/ios/KIF b/test/ios/KIF -Subproject ab5a46ff7e970de5578df48a1e1f013bd5e1bd4 +Subproject 976aafa2e211dd095411bfef09da6c0919d7047 |