I have a main app that will access multiple (self-created) Swift Packages. For a better user and tester experience I'd like to have a page that displays all Swift Package names and their respective version, however, these should be accessed programmatically and not in a hard-coded manner.
Since SPs only have their Package.swift
file, which so far I couldn't access (programmatically) from within the SP, I'm running out of ideas how to approach this issue. Any suggestions?
In previous approaches, where frameworks were added directly into the project, I could simply get these values the following way:
if let bundle = Bundle(identifier: "<framework_bundle_id>") {
if let res = bundle.object(forInfoDictionaryKey: "CFBundleShortVersionString") {
return res
}
}
For Swift Packages I still need a new solution.