Files
MapLibreParticleLab/platform/ios/src/NSBundle+MGLAdditions.m
Minh Nguyễn 26578ea9d5 [ios] Look for resources in static framework bundle
The library is packaged as a static framework, so there isn’t a separate resource bundle anymore. Instead, look for the static framework inside the Frameworks folder.
2016-01-22 14:45:57 -08:00

22 lines
683 B
Objective-C

#import "NSBundle+MGLAdditions.h"
#import "MGLAccountManager.h"
void mgl_linkBundleCategory() {}
@implementation NSBundle (MGLAdditions)
+ (instancetype)mgl_frameworkBundle
{
NSBundle *bundle = [self bundleForClass:[MGLAccountManager class]];
if (![bundle.infoDictionary[@"CFBundlePackageType"] isEqualToString:@"FMWK"]) {
// For static frameworks, the bundle is the containing application
// bundle but the resources are still in the framework bundle.
bundle = [NSBundle bundleWithPath:[bundle.privateFrameworksPath
stringByAppendingPathComponent:@"Mapbox.framework"]];
}
return bundle;
}
@end