Skip to content

Commit

Permalink
Merge pull request #7 from immobiliare/fix/6-bundle-discovery
Browse files Browse the repository at this point in the history
fix #6: fix bundle discovery in Bundle Extension
  • Loading branch information
malcommac authored Jan 11, 2022
2 parents 2a44775 + e12c88d commit 1eb741d
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ import Foundation

extension Bundle {

private static let internalBundle = Bundle(for: FlagsBrowserController.self)

internal static var libraryBundle: Bundle {
#if SWIFT_PACKAGE
return Bundle.module
Bundle.module
#else
return Bundle(for: Self.self)
[
Bundle(url: internalBundle.bundleURL.appendingPathComponent("RealFlags.bundle")),
internalBundle
].lazy.compactMap({ $0 }).first ?? Bundle.main
#endif
}

}

0 comments on commit 1eb741d

Please sign in to comment.