Skip to content

Commit

Permalink
changed to use resource_bundle instead of resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Francisco-Costa98 authored and Udumft committed Sep 29, 2023
1 parent 255e119 commit 624caad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MapboxNavigation.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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 ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #

Expand Down
11 changes: 10 additions & 1 deletion Sources/MapboxNavigation/Bundle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 624caad

Please sign in to comment.