Skip to content

arnaudlbbnc/DependencyResolver

Repository files navigation

DependencyResolver

Basic implementation of a dependency resolver letting users to have dependency injection in their projects.

Usage

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        let dependencies = DependencyResolver()
            .register(SomeProtocol.self, resolveClosure: SomeImplementation.init)
        dependencies.build()

        return true
    }
}

class SomeClass {
    @Inject var someProtocol: SomeProtocol?
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published