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

Shubham Singh

02/04/2023, 5:26 AM
Hey everyone.. is there a way to integrate a SwiftUI multiplatform project (i.e. it supports iOS, macOS, tvOS, and watchOS) in a KMP project? If so, is there an example repo for the same?
t

Tung97 Hl

02/04/2023, 6:25 AM
I think if you think the shared KMM module is just a library then it will be the same any swift project
s

Shubham Singh

02/04/2023, 6:34 AM
I found this article by John O Reilly https://johnoreilly.dev/posts/swiftui-multiplatform-kotlin-multiplatform/ But seems like now the SwiftUI app depends on a packaged KMP library Won't that be slower when it comes to simultaneous development? i.e. make changes to Kotlin code, publish it, and then consume it in the Swift project?
Just like a scratch KMM project that has the
ios
module already wired up to the
shared
module, I want an
apple
module to be wired up to the
shared
module so that whenever I make code changes inside
shared
, it's instantly available to the
apple
module.
t

Tung97 Hl

02/04/2023, 6:43 AM
Yes sure. Just create another sourceset and named it to be “apple”
p

Pablichjenkov

02/05/2023, 3:14 AM
You can take a look at this example from the compose-jb repo: https://github.com/JetBrains/compose-jb/tree/master/examples%2Ftodoapp
Interesting to also check the ones under the experimental folder: https://github.com/JetBrains/compose-jb/tree/master/experimental%2Fexamples
4 Views