Last active
December 21, 2020 18:29
-
-
Save ArtSabintsev/9b9fe72c54fb6ea16d42c05a988afd79 to your computer and use it in GitHub Desktop.
Bundle Extension for Swift PM and CocoaPods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private extension Bundle { | |
/// The path to Siren's localization `Bundle`. | |
/// | |
/// - Returns: The bundle's path or `nil`. | |
final class func sirenBundlePath() -> String? { | |
#if SWIFT_PACKAGE | |
return Bundle.module.path(forResource: "\(Siren.self)", ofType: "bundle") | |
#else | |
return Bundle(for: Siren.self).path(forResource: "\(Siren.self)", ofType: "bundle") | |
#endif | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment