I am working on a framework for iOS, which comes with some datafiles. To load them into a Dictionary I do something like this:
Dictionary
public func loadP
Use Bundle(for:Type):
Bundle(for:Type)
let bundle = Bundle(for: type(of: self)) let path = bundle.path(forResource: filename, ofType: type)
Update:
or search the bundle by identifier (the frameworks bundle ID):
identifier
let bundle = Bundle(identifier: "com.myframework")