https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
v

Vladimir Vainer

10/08/2023, 6:19 AM
How to use swift-only libraries from kmp library project? In the kmp app project i can use dependency injection, implement kotlin interface in swift and pass it on. But in kmp library project i do not have an xcode project where i can do this. How kmp library authors add dependenices on swift-only libraries?
v

Vlad

10/17/2023, 8:44 AM
You create your own library, which implements a wrapper to communicate with swift only 3rd library and opens obj-c compatible interface for the KMP. From KMP part you use that wrapper.
v

Vladimir Vainer

10/17/2023, 9:15 AM
Yes, but this is not an ideal solution. As now consumers of my library need to also manually link with my wrapper library.
v

Vlad

10/17/2023, 9:16 AM
I didn't say it is ideal.
v

Vladimir Vainer

10/17/2023, 9:17 AM
🙂
I thought that whole purpose of kotlin multiplatform is to be awesome / ideal 🙂 .
v

Vlad

10/17/2023, 9:19 AM
It is in beta
2 Views