Skip to content

Commit e0cf0f6

Browse files
changed to use resource_bundle instead of resource (#4525)
1 parent 255e119 commit e0cf0f6

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

MapboxNavigation.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Pod::Spec.new do |s|
3636

3737
# ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
3838

39-
s.resources = ['Sources/MapboxNavigation/Resources/*/*', 'Sources/MapboxNavigation/Resources/*']
39+
s.resource_bundle = {'MapboxNavigationResources' => ['Sources/MapboxNavigation/Resources/*/*', 'Sources/MapboxNavigation/Resources/*']}
4040

4141
# ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
4242

Sources/MapboxNavigation/Bundle.swift

+10-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,16 @@ extension Bundle {
1212
#if SWIFT_PACKAGE
1313
return .module
1414
#else
15-
return Bundle(for: NavigationViewController.self)
15+
var frameworkBundle = Bundle(for: NavigationViewController.self)
16+
17+
guard let resourceBundleURL = frameworkBundle.url(
18+
forResource: "MapboxNavigationResources", withExtension: "bundle")
19+
else { fatalError("MapboxNavigationResources.bundle not found!") }
20+
21+
guard let resourceBundle = Bundle(url: resourceBundleURL)
22+
else { fatalError("Cannot access MapboxNavigationResources.bundle!") }
23+
24+
return resourceBundle
1625
#endif
1726
}
1827
}

0 commit comments

Comments
 (0)