diff --git a/MapboxNavigation.podspec b/MapboxNavigation.podspec index fa89fd37465..5e3dcd4a96d 100644 --- a/MapboxNavigation.podspec +++ b/MapboxNavigation.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - s.resources = ['Sources/MapboxNavigation/Resources/*/*', 'Sources/MapboxNavigation/Resources/*'] + s.resource_bundle = {'MapboxNavigationResources' => ['Sources/MapboxNavigation/Resources/*/*', 'Sources/MapboxNavigation/Resources/*']} # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # diff --git a/Sources/MapboxNavigation/Bundle.swift b/Sources/MapboxNavigation/Bundle.swift index 51bf8906e79..eff3ae5fdfb 100644 --- a/Sources/MapboxNavigation/Bundle.swift +++ b/Sources/MapboxNavigation/Bundle.swift @@ -12,7 +12,16 @@ extension Bundle { #if SWIFT_PACKAGE return .module #else - return Bundle(for: NavigationViewController.self) + var frameworkBundle = Bundle(for: NavigationViewController.self) + + guard let resourceBundleURL = frameworkBundle.url( + forResource: "MapboxNavigationResources", withExtension: "bundle") + else { fatalError("MapboxNavigationResources.bundle not found!") } + + guard let resourceBundle = Bundle(url: resourceBundleURL) + else { fatalError("Cannot access MapboxNavigationResources.bundle!") } + + return resourceBundle #endif } }