Sharing 100% pure business logic in Kotlin while rendering 100% native SwiftUI and Jetpack Compose UIs.
Sharing the exact same vehicle engine, transmission, and fuel injection system across two sports cars, while letting iOS install a bespoke Italian leather interior and Android install a high-tech carbon fiber cockpit.
commonMain: Write shared networking (Ktor), serialization (Kotlinx), and database (SQLDelight)
KMP compiler produces .aar library for Android and .framework for iOS
iOS Developer imports shared framework directly into Xcode: import SharedKit
SwiftUI views observe shared StateFlow / Coroutines via Native Swift bindings
Achieves 100% platform-native UI performance with zero bridge or canvas overhead
// commonMain/Repository.kt (Shared Kotlin Logic)
class RocketRepository(private val api: SpaceXApi) {
suspend fun fetchLaunches(): List<Launch> {
return api.getLaunches().filter { it.launchSuccess == true }
}
}
// iOS (SwiftUI View)
struct LaunchListView: View {
@ObservedObject var viewModel: ObservableLaunchViewModel
var body: some View {
List(viewModel.launches, id: \.id) { launch in
Text(launch.missionName) // 100% Pure SwiftUI!
}
}
}Kotlin/Native LLVM compilation produces zero-runtime-overhead binary binaries that link directly with iOS UIKit and SwiftUI.