Does anyone have a working example with kodein on ...
# kodein
n
Does anyone have a working example with kodein on iOS?
r
Hi there. Actually the API is not really iOS friendly. But we are working on something to make as smooth as on Android.
👍 1
But I made some code to show how to use kodein through common code on iOS
you need to set up a *bridge" that will expose your dependencies
And here, you can see how I use it on iOS
Hope this will help
n
Yupp, thank you 😄
s
If I’m reading this correctly, it’s not currently possible to inject our dependencies in iOS code as a per class just like we can do it inside the Kotlin code. We have to create a class that’s being injected all the dependencies and use that class inside the Swift code? Thanks for the clarification 🙂
r
Yep, for the moment this is the simplest way to use KMP injection, by defining a facade to your DI injection within an object or a class that will be used in Swift.
we are planning to bring support for injection in Swift, not sure how and when yet.
s
Would be really fun! Are there any work done about this?
Or any issue created on GitHub? Let say if we want to contribute or at least be informed of updates
r
Nothing yet, we are currently moving the API to a new form and new internals before improving it, but any contribution is welcome. If. You want you can create the issue and we will get onto it right after the v7 release, around March
s
Thanks! I’ll create the issue and see if I can contribute to some extend.
138 Views