Nice little µframework for loading 'local' Bundle JSON resources. Could be extended for other file types.
On first checkout you best run: $ make setup that will trigger the scripts/setup bash script to run
and check the required dependencies and generate the Xcodeproj.
let bundle = Bundle.main.bundleFromResources(name: "BundleName[.bundle]")
let json = bundle?.decode(ObjectType.self, from: "file.json")Put this in your Package.swift:
...
dependencies: [
.package(url: "https://github.com/SwiftCommon/BundleKit", "0.0.1" ..< "1.0.0")
],
targets: [
.target(
name: "YourAwesomeApp",
dependencies: ["BundleKit"]
)
]Licensed under the MIT license.