Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed to use resource_bundle instead of resource #4525

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading