Hello there, I use swiftklib to be able to use Swi...
# multiplatform
l
Hello there, I use swiftklib to be able to use Swift implementation in kotlin. When using basic swift this just works but as soon as i want to use external dependencies in this swift code (like we usualy do with spm) my imports and code are not recognized; Looks simple still I don't know what's the best practice to fix this.
p
Most people are creating their own bridges. Apparently there is not a standard library or framework for this yet. People are bridging based on the following techniques: https://stackoverflow.com/questions/77541454/call-swift-code-from-kotlin-multiplatform Good reading here: https://medium.com/@mofeejegi/calling-platform-specific-dependencies-in-kotlin-multiplatform-69dbc9a841a2
There is a good framework https://github.com/touchlab/compose-swift-bridge But only for automatic binding of Composables. You can create a feature request to expand it to any interface.
l
Thank you 🙂 tbh I already knew the hack with interface + swift implementation on ios project but i want to embed the swift implementation in a sdk so this is not viable for what i want to do. Also I finally found what i was looking for but it's wip : https://github.com/ttypic/swift-klib-plugin/pull/47/ . Anyway thanks for the resources, I learned some things with these great shares thanks :)
👍 1
p
That PR sounds great 😃👍
m