Use relative bundle to locate URL in framework

This commit is contained in:
Davide De Rosa 2019-03-18 10:56:53 +01:00
parent c7f522f55e
commit d983362815
1 changed files with 2 additions and 1 deletions

View File

@ -244,9 +244,10 @@ private extension Infrastructure.Name {
}
var bundleURL: URL? {
let bundle = Bundle(for: InfrastructureFactory.self)
let endpoint = WebServices.Endpoint.network(self)
// e.g. "Web", PIA="net/pia" -> "[Bundle]:Web/net/pia.json"
return Bundle.main.url(forResource: "\(AppConstants.Store.webCacheDirectory)/\(endpoint.path)", withExtension: "json")
return bundle.url(forResource: "\(AppConstants.Store.webCacheDirectory)/\(endpoint.path)", withExtension: "json")
}
}