SwiftCommon / Steroids

@Injected is Swinject on Steroids

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:MIT License


Languages

Language:Swift 52.2%Language:Shell 42.4%Language:Makefile 5.4%