Can anyone recommend a good IoC framework for iOS to facilitate dependency injection?
The only one I’ve found so far is Objection Framework which apparently is similar to Guice (which unfortunately is unfamiliar to me). Is this one a common choice for iOS and are there competing frameworks that are worth checking out?
Objection is the DI library I could find on google for iOS, so you might be stuck with it if you want a pre-built library.
DI doesn’t specifically require a framework to use. If your app is small, you can simply create all your instances at the application root and inject by hand.
If you need more than this, and the existing frameworks aren’t cutting it for you, you could roll your own Service Locator, then build a DI container on top of it.
You could also port an existing smaller framework from another platform. There are several “small” ones on .Net, for example – Ninject and SimpleInjector.
It seems that it is a fairly small project as there is only one author/contributor listed. There aren’t many issues filed. The iOS market is fairly large though. So I’m thinking that only a very small portion of all iOS developers use this library.
But this isn’t necessarily a bad thing. It seems to be created, used, and supported by a small company. It has had fairly steady updates for the past year.
My anecdotal experience with similarly scoped open source projects: I don’t always get new features super-often, and I’m often the one who ends up finding bugs. But I tend to get support on the existing feature set very quickly, and a lot of attention is paid to support e-mails I’ve sent. YMMV.