header image for landing page for KMP for iOS devs

Reasons to explore Kotlin Multiplatform as an iOS developer:

Swift is like Kotlin

Both languages share similar ideologies because they’re looking to solve the same problems created by their predecessors.

N

Kotlin Multiplatform Opportunity

It’s a great time to be an iOS developer in the KMP open-source community because iOS experience is in demand. 

Work Closer with Android

Kotlin isn’t going anywhere in the Android world. The worst case scenario for an iOS dev is that KMP code sharing doesn’t take off, and they’re left with Kotlin and Android Studio experience under their belt.

+

Native UI

Kotlin Multiplatform is optimized for sharing up until the platform’s native UI; it leaves the stuff that iOS developers hold important untouched. 

Native Tooling

With the available Kotlin Xcode plugin, you can see and debug Kotlin right alongside your Objective-C and Swift code.

Kotlin Multiplatform Flexibility

Kotlin has excellent interop. It allows for optional code sharing. It’s also modular in its approach to working with existing apps. You can try one small piece of code without impacting the rest of the iOS app.

KMP Docs That Work for iOS Developers 

The goal of our Kotlin Multiplatform kit for iOS developers is get you running KMP as fast as possible. Our kit facilitates your iOS team’s evaluation of Kotlin Multiplatform (KMP).

 

The KMP ecosystem has generated a lot of excitement, and has evolved very rapidly. As a result, there’s a lot of old or conflicting documentation, blog posts, tutorials, etc. We, Touchlab, have worked with several teams looking at KMP, and have found that the primary stumbling block is simply getting started.

Need troubleshooting help?

If you’d like to troubleshoot or ask questions related to our kit for iOS developers, first request to join the JetBrains Kotlinlang Slack and then search and join the “kampkit-support” channel.

See you in Slack! 

What’s in Touchlab’s Kotlin Multiplatform kit for iOS developers? 

KMP for iOS Tutorial

Our tutorial provides instructions to help iOS devs get KMP running as fast as possible

k

Educational Resources

Introductory information on KMP and Kotlin/Native.

*

Kotlin/native xcode plugin

Plugin to facilitate debugging iOS applications using Kotlin Native in Xcode

Excerpt from our InfoQ Tutorial: Android Studio for iOS Devs

DRY (or Don’t Repeat Yourself) is one of the foundational principles of programming, but repeating lots of logic has been often necessary to develop an app running on multiple platforms.

Trying to minimize repetition is just good programming. And more shared code across platforms means less repetition, which means better code.

Think about your iOS current project: is it available on any other platforms, like Android or the web? If so: how much logic does your iOS app share with its counterparts on those other platforms? If not, but making your app available on another platform is on the roadmap, how much will developing on the next platform force you to repeat yourself? Either way, the answer is probably: a lot.

Enter Kotlin Multiplatform (KMP). Kotlin is a statically-typed programming language that bears a striking resemblance to Swift, and is 100% interoperable with Java. In many ways, it’s Swift for Android. KMP is a feature of Kotlin which shares code between an app’s various platforms, so that each platform’s natively programmed UI calls into the common code. KMP is not the final step to accomplishing 100% shared code across all platforms, but it is the natural next step towards that goal.

KMP works by using Kotlin to program business logic that is common to your app’s various platforms. Then, each platform’s natively programmed UI calls into that common logic. UI logic must still be programmed natively in many cases because it is too platform-specific to share. In iOS this means importing a .frameworkfile – originally written in KMP – into your Xcode project, just like any other external library. You still need Swift to use KMP on iOS, so KMP is not the end of Swift.

KMP can also be introduced iteratively, so you can implement it with no disruption to your current project. It doesn’t need to replace existing Swift code. Next time you implement a feature across your app’s various platforms, use KMP to write the business logic, deploy it to each platform, and program the UIs natively. For iOS, that means business logic in Kotlin and UI logic in Swift.

The close similarities between Swift’s and Kotlin’s syntax greatly reduces a massive part of the learning curve involved with writing that KMP business logic. What’s left in that learning curve is the IDE: Android Studio.

Developers appreciate our mobile dev kits

“…was able to build and run both platforms with no issues and fast build times.”

Tyler Turnbull
Mobile, The Walt Disney Company

Wow great work! I was able to open the iOS project as well after I ran the build command. I still have to wrap my head around the whole idea but very NICE!

Angel Rodriguez
Mobile, Watsco

Touchlab Contributors to the KMP Kit for iOS Devs

Kevin Galligan

Partner

Sam Hill

Engineering Manager

Kevin Schildhorn

Multiplatform Engineer

Ben Whitley

Multiplatform Engineer

Russell Wolf

Multiplatform Engineer

header image for landing page for KMP for iOS devs

Join our KMM newsletter and connect with the community!