Skip to content

SwiftCommon/Steroids

Repository files navigation

Steroids for Swinject

Swift 5.0+ license Build Status codecov

@Injected is Swinject on Steroids.

Getting started

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.

Features

Injected propertyWrapper

class VeryClass {
    @Injected var someService: SomeAwesomeService
    @Injected(name: "crystal") var namedService: SomeAwesomeService
}

Register through Swinject Container

// Register a Service
Dealer.shared.push(name: "crystal") { _ in MagicBlues() as SomeAwesomeService }

// Remove all registrations
Dealer.shared.reset()

Installation

Swift PM

Put this in your Package.swift:

    ...
    dependencies: [
       .package(url: "https://github.com/SwiftCommon/Steroids", from: "0.0.1")
    ],
    targets: [
       .target(
          name: "YourAwesomeApp",
          dependencies: ["Steroids"]
       )
    ]

License

Licensed under the MIT license.

About

@injected is Swinject on Steroids

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors