Kotlin Multiplatform Mobile — An iOS Engineer’s Hot Take
Originally published at blog.malcolmk.com.
In this article, I will be discussing why I believe that Kotlin Multiplatform Mobile (KMM) is the future of cross-platform development from the viewpoint of an iOS Engineer.
This is a highly opinionated piece and I am very aware that some might have opposing opinions hence — hot take.
Hot Take (noun) — a piece of writing or speech, especially on the internet, giving someone’s personal opinions about a topic, usually strong opinions that have not been carefully thought about and that many people are likely to disagree with Cambridge Dictionary
Have you ever downloaded an app, opened it, browsed through it, and think something just does not feel right? Ever wondered why an app is not smooth and why some elements seem out of place? It could be that the app in question was developed using a cross-platform framework.
The promise of cross-platform development is “code once, deploy everywhere”. Whilst frameworks like React-Native and Flutter do really well to deliver on this promise there are some caveats that raise concern. User Interface and latest platform features is an area in which I feel like these frameworks fall short. In practice, this may not be the fault of the framework but rather that of the engineer not taking the time to ensure that the final result conforms to specific platform standards.
To make a good cross-platform application one has to be conscious of platform differences and cater to them. iOS has its Human Interface Guidelines and Android has Material Design. For your app to feel at home on a device it is crucial that you adhere to the platform principles.
This leads to one have to write code for each platform somewhat creating a nuisance in the development process. “I was promised write once, deploy everywhere. But to make it look nice and work properly I still have to code twice?” Eventually, you could end up in the not ideal situation of having a codebase that has so many if or switch statements to cater for platform-specific code.