News for hackers. Stuff that matters.
Re:Kotlin Multiplatform for Android and iOS Apps by mike_hearn on Monday September 25, 2023 @12:57PM (#37646993)
The idea is you can write SwiftUI on iOS, whilst connecting to business logic written in Kotlin.
Re:Kotlin Multiplatform for Android and iOS Apps by medo-bear on Monday September 25, 2023 @01:40PM (#37647696)
im not a phone app dev, but im curious, cant you already write backend code in another language and the ui in swift
Re:Kotlin Multiplatform for Android and iOS Apps by azarovalex on Monday September 25, 2023 @02:06PM (#37648083)
Business logic is not only about backend. Apps usually have a lot of client-side logic that can be written once in KMM and used on both platforms. See [1] for a high level architecture diagram.

I'm an iOS dev and I've been using KMM on a couple of projects for more than a year now. It's really a powerfull technology which allows teams to move faster, but there are downsides, for example lack of native Swift interop, though there are opensource tools trying to solve this [2].

[1]: https://github.com/Kotlin/kmm-production-sample/tree/master#... [2]: https://github.com/touchlab/SKIE

Re:Kotlin Multiplatform for Android and iOS Apps by dickersnoodle on Monday September 25, 2023 @03:39PM (#37649428)
Sort of but not really. SwiftUI is reactive, with view changes triggered by changes in Swift variables and those changes triggered using Combine. The later iterations of Swift include async/await to greatly simplify async code (normally but not always focused on network endpoints). You can write everything you need without having to drag Kotlin into the mix, and including Kotlin will require bridge code that seems (to me, at least) an unwanted obligation just to let some executive say "We saved some money by sharing code!".
Re:Kotlin Multiplatform for Android and iOS Apps by whoopsie on Monday September 25, 2023 @04:12PM (#37649918)
No no no. Just look at the janky stuff one needs to do to compile Kotlin for an iOS project. Plus, object lifetime semantics differ. Now you won’t be able to write Kotlin native code without thinking of iOS rules. So now you have the worst of unfamiliar worlds with a “most fast” product speed.