TODO
- Easify registering and resolving dependency syntax?
- Support registering multiple instance of the same type?
- Add code documentation
- Add unit test execution github action
- Integrate code coverage app (codecov)
- Unit test code coverage %100
// Lazy singleton is created when you access it
GetIt.I.registerLazySingleton(TestProtocol.self) { TestClass() }
// Singleton is already created by you
GetIt.I.registerSingleton(TestProtocol.self, instance: TestClass())
// New instance is created every time you access it
GetIt.I.registerFactory(TestProtocol.self) { TestClass() }
if let instance = GetIt.I.resolve(TestProtocol.self) {}
// More swifty syntax
if let instance = GetIt.I(TestProtocol.self) {}
// Access by annotation
@Injected(TestProtocol.self) var instance
instance().foo()
let isRegistered = GetIt.I.isRegistered(TestProtocol.self)
GetIt.I.unregister(TestProtocol.self)