In my Compose Multiplatform app, an iOS API I am interested about is not available via kotlin multiplatform.
Is there a way to write it in Swift and use the class from kotlin?
If this is not the best channel to ask, let me know
v
Vlad
03/19/2024, 12:56 PM
Write it in in Obj-c compatible Swift. Pack as a library and add the library to iosMain()
a
Alex Styl
03/19/2024, 1:53 PM
figured it out. Turns out I can use Kotlin code from Swift in my Compose app.
had to
import ComposeApp
and rebuild the project on xcode, otherwise xcode doesnt pick it up
e
Eduardo Ruesta
03/19/2024, 2:29 PM
Hey Alex! its good to know that! can you give me an example of why you need that? if you need an iOS API why you need to import ComposeApp from xcode? Thanks
a
Alex Styl
03/20/2024, 3:08 AM
because of the wiring. made a kotlin interface, implemented it in Swift, got a shared