From c4558d48f2ac74b3c2413eb8c363688e430b1177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Fri, 20 Nov 2015 00:13:44 -0800 Subject: [iOS] Set application root as asset root As of #2746, we no longer bundle any styles with the SDK, so the asset: URL scheme is unused. Instead, point asset: to the application root for developer convenience and consistency with the Android and default asset roots. Also fixed an issue that prevented relative URLs from being treated as asset: URLs. Fixes #1208, fixes #3050. --- platform/darwin/asset_root.mm | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'platform/darwin') diff --git a/platform/darwin/asset_root.mm b/platform/darwin/asset_root.mm index f47f5d36d1..a4a3d13c88 100644 --- a/platform/darwin/asset_root.mm +++ b/platform/darwin/asset_root.mm @@ -2,24 +2,13 @@ #include -@interface MGLApplicationRootBundleCanary : NSObject -@end - -@implementation MGLApplicationRootBundleCanary -@end - namespace mbgl { namespace platform { // Returns the path to the root folder of the application. const std::string &assetRoot() { static const std::string root = []() -> std::string { - NSString *path = [[NSBundle bundleForClass:[MGLApplicationRootBundleCanary class]] pathForResource:@"Mapbox" ofType:@"bundle"]; - if (!path) { - path = [[[NSBundle mainBundle] resourceURL] path]; - } - return {[path cStringUsingEncoding : NSUTF8StringEncoding], - [path lengthOfBytesUsingEncoding:NSUTF8StringEncoding]}; + return [[[[NSBundle mainBundle] resourceURL] path] UTF8String]; }(); return root; } -- cgit v1.2.1