Swinject / SwinjectAutoregistration

Swinject extension to automatically register your services
MIT License
249 stars 45 forks source link

More auto extensions #56

Closed timqzm closed 3 years ago

timqzm commented 4 years ago

Hi guys, I wrote 2 more autoregstration-like extensions just for fun.

But probably there is something useful in them?

I'll be grateful if you take a look and share your opinion 😊

timqzm commented 4 years ago

@yoichitgy @tkohout @jakubvano please 🙏

tkohout commented 4 years ago

Hi @timqzm! sorry, I missed this one. Thanks for your contribution!

I think the autoInitCompleted would make sense to add to the library. I did not have to use initCompleted in my projects yet - do you find yourself writing the code for initCompleted a lot?

For the storyboard init, this would require for autoregistration to have SwinjectStoryboard as its dependency. Maybe it is possible to use it only conditionally - I would have to look how do conditional imports work in swift, but for now, I don't think there's an easy way of incorporating it in the extension.

timqzm commented 4 years ago

Well, in my current project: 0 use of initCompleted 1 autoInitCompleted - for resolving a circular dependency 30+ autoStoryboardInitCompleted - for every ViewController 😊