Hi Guys, I am trying to use Koin Multiplatform fo...
# touchlab-tools
a
Hi Guys, I am trying to use Koin Multiplatform for dependency injection. Is there a way to add to the Koin Module when using it in kotlin so I could add in ios specific dependencies?
Copy code
val doOnStartup = koin.get<() -> Unit>() // doOnStartup is a lambda which is implemented in Swift on iOS side
doOnStartup.invoke()
Apparently this should solve my issue but I'm not really sure how this works.
k
Same question asked recently. I think we should update the docs on it, but here's the response: https://kotlinlang.slack.com/archives/CTJB58X7X/p1615220677003200
r
Not sure exactly what your need is, but be aware that you can't bind things to Koin that have Swift/Obj-C types. So KaMPKit does
Copy code
single<Settings> { AppleSettings(userDefaults) }
but you couldn't instead do
Copy code
single<NSUserDefaults> { userDefaults }
a
I got it now thank you very much.