SwinjectSafeAuto allows to auto-register services to the container and verify the required services are properly registered.
This project is inspired by SwinjectAutoregistration.
container.autoregister(NetworkingProtocol.self, initializer: Networking.init)
container.autoregister(MyServiceProtocol.self, initializer: MyService.init)
// This method will throw an error in DEBUG build when the required services are not properly reigstered.
try! container.verify()
// You can safely resolve services after verification.
container.resolve(MyServiceProtocol.self)
container.register()
.SwinjectSafeAuto is under MIT license. See the LICENSE file for more info.
link |
Stars: 15 |
Last commit: 3 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics