KMP: Shared Logic Without Shared UI
When we started our Kotlin Multiplatform project, the temptation was to share everything — including UI. We resisted that urge, and it turned out to be the right call.
The approach
Our shared module handles three things: networking (Ktor), local caching (SQLDelight), and domain logic. Everything above that layer is platform-native.
On Android, we use Jetpack Compose. On iOS, SwiftUI. The shared Kotlin code compiles to a framework that iOS consumes directly.
Why not share UI?
Compose Multiplatform is impressive, but our iOS users expect iOS-native behavior. Swipe-back navigation, platform haptics, accessibility patterns — these are hard to replicate in a cross-platform UI layer.
Results
- 60% code sharing by line count
- Native feel on both platforms
- One team maintaining shared logic
- Platform teams focus on UI polish
The key insight: share the boring parts (networking, caching, business rules) and let each platform shine where it matters most.