Minject is a minimum Dependency Injection framework for Swift.
It is designed for developers to avoid depending on "magical" behavior and have explicit control by self.
To run the example project, clone the repo, and run pod install
from the Example directory first.
What you can do with Minject is simple. Register
dependencies into the container and resolve
when you need an instance.
let diContainer = DIContainer()
.register(TodoRepository.self, TodoRepositoryImpl.shared)
.register(TodoPresenter.self) { TodoPresenter(todoRepository: $0.resolve()) }
let repository: TodoRepository = diContainer.resolve()
let presenter: TodoPresenter = diContainer.resolve()
See Minject.podspec
file for more info.
Minject is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Minject'
Tomohiro Matsumura, thedoritos@gmail.com
Minject is available under the MIT license. See the LICENSE file for more info.