Hi, Is it possible to use Kodein when developing a Compose Multiplatform Android&IOS application?
👌 2
r
rocketraman
05/12/2023, 9:07 PM
At the moment the iOS API is not super-friendly, so you have to set up a small bridge the exposes the dependencies to iOS. But otherwise, it works well, and an iOS API is expected in the near future.
rocketraman
05/12/2023, 9:18 PM
Join #kodein if you haven't already
s
Stanislav Radchenko
05/13/2023, 6:47 AM
How can I do
bridge
for IOS?
For example, on Android I do init of Kodein like this:
Copy code
class AndroidApp : Application(), DIAware {
override fun onCreate() {
super.onCreate()
}
override val di: DI by DI.lazy {
import(appModuleDI)
import(androidModuleDI)
}
}
How do I do the same thing on iOS?
Stanislav Radchenko
05/13/2023, 6:56 AM
My goal is to inject dependencies within composable functions and also for other classes. That is, I mean, I'm not going to use from native swift code
s
SrSouza
05/14/2023, 5:40 PM
IF you are writing a Application fully in Compose Multiplatform or if you want your Graph to be available only on your Compose Multiplatform Screen you can use the extension