@Injected is Swinject on Steroids.
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.
class VeryClass {
@Injected var someService: SomeAwesomeService
@Injected(name: "crystal") var namedService: SomeAwesomeService
}
// Register a Service
Dealer.shared.push(name: "crystal") { _ in MagicBlues() as SomeAwesomeService }
// Remove all registrations
Dealer.shared.reset()
Put this in your Package.swift
:
...
dependencies: [
.package(url: "https://github.com/SwiftCommon/Steroids", from: "0.0.1")
],
targets: [
.target(
name: "YourAwesomeApp",
dependencies: ["Steroids"]
)
]
Licensed under the MIT license.