6 ms·
The idea is you can write SwiftUI on iOS, whilst connecting to business logic written in Kotlin.
by mike_hearn 3y ago
The idea is you can write SwiftUI on iOS, whilst connecting to business logic written in Kotlin.
- medo-bear 3y agoim not a phone app dev, but im curious, cant you already write backend code in another language and the ui in swift
- azarovalex 3y agoBusiness 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#architecture https://github.com/Kotlin/kmm-production-sample/tree/master#... [2]: https://github.com/touchlab/SKIE https://github.com/touchlab/SKIE
- dickersnoodle 3y agoSort 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!".
- whoopsie 3y agoNo 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.