Hello everyone, I want to convert my existing app ...
# android
d
Hello everyone, I want to convert my existing app ( Written in kotlin ) to KMM for both Android and iOS without writing code in swift/objective-c. Is it possible to write the UI as well as business logic in kotlin for both Android and iOS. Is it possible with kotlin only ?
🚫 4
c
No Kotlin can't be used for building UI on an iOS app (at the moment)
Kotlin multiplatform uses Kotlin Native
Copy code
Kotlin/Native is an LLVM backend for the Kotlin compiler, runtime implementation, and native code generation facility using the LLVM toolchain.

Kotlin/Native is primarily designed to allow compilation for platforms where virtual machines are not desirable or possible (such as iOS or embedded targets), or where a developer is willing to produce a reasonably-sized self-contained program without the need to ship an additional execution runtime.
d
@Clament John thanks for your reply. So currently to writing the app using KMM for both Android and iOS you should have knowledge of swift and objective-c. Will wait for this.
c
Yes. You can write the business logic in KMM and the android UI and platform code in Kotlin. But iOS UI and platform code must be written in Swift.
👍 1
g
No Kotlin can’t be used for building UI on an iOS app (at the moment)
But it’s not correct. You can use Kotlin to write apps using UIKit
Of course you cannot share this logic with Android, but you can implement Layout/View using K/N
c
Oh I'm sorry. I was only speaking from my understanding of K/N (which can compile your code to multiple platforms) But UI is usually a set of rich libraries (like compose) and my answer was from this understanding @gildor
g
UI is usually a set of rich libraries
Correct, but it how for example Kotlin works on Android (before compose), it just possible to use system UI framework which is Java framework, from Kotlin, similar you can use Kotlin on iOS with UIKit