Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Get bundle path just once
Browse files Browse the repository at this point in the history
  • Loading branch information
friedbunny committed May 23, 2017
1 parent b1be1fd commit fd597d3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions platform/darwin/src/NSBundle+MGLAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ @implementation NSBundle (MGLAdditions)
+ (instancetype)mgl_frameworkBundle {
NSBundle *bundle = [self bundleForClass:[MGLAccountManager class]];

if (![bundle.infoDictionary[@"CFBundlePackageType"] isEqualToString:@"FMWK"] && [bundle pathForResource:@"Mapbox" ofType:@"bundle"]) {
if (![bundle.infoDictionary[@"CFBundlePackageType"] isEqualToString:@"FMWK"]) {
// For static frameworks, the bundle is the containing application
// bundle but the resources are in Mapbox.bundle.
bundle = [self bundleWithPath:[bundle pathForResource:@"Mapbox" ofType:@"bundle"]];
NSString *bundlePath = [bundle pathForResource:@"Mapbox" ofType:@"bundle"];
if (bundlePath) {
bundle = [self bundleWithPath:bundlePath];
}
}

return bundle;
Expand Down

0 comments on commit fd597d3

Please sign in to comment.