summaryrefslogtreecommitdiff
path: root/platform/osx/sdk/NSBundle+MGLAdditions.m
blob: a53802c343afe4b6393652842456212a4fe3f2e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#import "NSBundle+MGLAdditions.h"

#import "MGLAccountManager.h"

void mgl_linkBundleCategory() {}

@implementation NSBundle (MGLAdditions)

+ (instancetype)mgl_resourceBundle {
    return [self bundleWithPath:[self mgl_resourceBundlePath]];
}

+ (NSString *)mgl_resourceBundlePath {
    NSString *resourceBundlePath = [[self bundleForClass:[MGLAccountManager class]]
                                    pathForResource:@"Mapbox" ofType:@"bundle"];
    if (!resourceBundlePath) {
        resourceBundlePath = [[self mainBundle] bundlePath];
    }
    return resourceBundlePath;
}

@end