ivlevAstef / DITranquillity

Dependency injection for iOS (Swift)
MIT License
422 stars 32 forks source link

auto init #73

Closed ivlevAstef closed 7 years ago

ivlevAstef commented 7 years ago

if class containts one init method:

register(type: Cat.self).initializer(Cat.init) register(init: Cat.init)

because Cat.init it's method, and library can has more generic initializer methods for auto detected Types. e.q. func initializer<P1,P2, Type>( initMethod: ( p1: P1, _ p2: P2) -> Type) { self.initializer { scope in return initMethod(!scope.resolve, !scope.resolve) } }

branch: https://github.com/ivlevAstef/DITranquillity/tree/automatics