https://kotlinlang.org logo
#compose-ios
Title
# compose-ios
a

Alex Styl

03/19/2024, 12:14 PM
A 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 in an Compose Multiplatform app?
google 1
m

magnumrocha

03/19/2024, 12:59 PM
You can transform your Swift code on an XCFramework containing a Header file (.h) and then you can use cinterop from KMP to access it
another option is to rewrite your Swift library in Kotlin Native (iOS target)
1
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
👍 2
2 Views