If it's not possible, are there any workarounds? (On my use case, I need to add BASE_URL from a xcconfig file configuration. Maybe I can find another way to do this but I would like to do what I did on Android side using buildConfig fields)
c
curioustechizen
12/02/2023, 2:22 AM
Check the touchlab samples. I think KampKit was the one with such an example.
The approach is that you define an object on the Kotlin side, say,
And on Swift side where you need an instance, you call it like
Copy code
KotlinDependencies.shared.getBaz("BASE_URL")
curioustechizen
12/02/2023, 2:23 AM
So you still define all modules on the Kotlin side. But you can still pass dependencies from the Swift side.
o
Osman Saral
12/04/2023, 8:10 AM
I'm actually using KaMPKit but it's not what I want. This still requires Baz to be defined in kotlin side. I want to define Baz in Swift side. What you shared is just a way to get a dependency with another function. It doesn't create a definition from swift side, it only injects dependency "to" the swift side.