Nov 17, 2026

Buen Día: From Native Swift to Kotlin Multiplatform, 82% Shared

I took a native iPhone app written in Swift and rebuilt it in Kotlin Multiplatform and Compose Multiplatform. About 82% of the code is now shared, and the same app went to Google Play.

Buen Día: From Native Swift to Kotlin Multiplatform, 82% Shared

Buen Día started as a native iPhone app: about 4,500 lines of Swift, SwiftUI and Apple's on-device Speech and Translation frameworks. It is on the App Store. This week the same app went to Google Play for review, and it is no longer a Swift app. It is a Kotlin Multiplatform (KMP) app with a Compose Multiplatform (CMP) interface, and the code is about 82% shared between iPhone and Android.

I counted, because "mostly shared" is the kind of claim that deserves a number.

What the app does

Buen Día teaches Spanish from real podcasts, one sentence at a time. It transcribes each sentence of a podcast episode on the device, translates it, lets you tap any word, skips the ad breaks, and has a hands-free Driving Mode. Most of this code is audio, speech, translation and a lot of state, which is exactly what you hope a shared layer can own.

The numbers

Lines of Kotlin and Swift, counted with wc -l, tests and generated code excluded:

PartLanguageLinesShare
Shared (commonMain: UI, logic, data, audio and TTS orchestration)Kotlin10,94581.8%
Platform glue (expect/actual in androidMain and iosMain)Kotlin1110.8%
Android host (app/)Kotlin1,1918.9%
iOS host (iosApp/)Swift1,1378.5%
Total13,384100%
  • About 82% of the code runs on both platforms (83% if you count the tiny expect/actual layer, which is mostly shared by design).
  • Each developer sees about 12,100 to 12,200 lines. An Android developer works with the shared code plus Android's own: 10,945 + 50 + 1,191, about 12,200. An iOS developer works with the shared code plus iOS's own: 10,945 + 61 + 1,137, about 12,100. About 90% of what each one reads is the same shared code, and only about 10% is specific to their phone.
  • 1,300 more lines of tests live in the shared module and run once for both phones.
  • The biggest files are all shared: the player screen (1,834 lines), the app controller (1,223), the voice sheet (1,077), the liquid-glass styling (1,016) and the neural voice engine (735).

A caveat I owe you. This is not a like-for-like port. The original Swift app was about 4,500 lines, and the shared app is about 11,000, so the new version is not a smaller rewrite. It is a bigger app: it gained an Android build, an on-device neural voice (Kokoro-82M via ONNX Runtime) with an accent slider, and a redesigned interface. Line counts say how much code exists, not how much it is worth.

What stayed native

The 17% that is not shared is the interesting part, because it is exactly the part that should be native:

  • Speech recognition. iPhone uses Apple's SpeechAnalyzer. Android uses ML Kit's on-device speech recognition.
  • Translation. Apple's Translation framework on iPhone, ML Kit Translate on Android.
  • Audio playback. AVAudioEngine on iPhone, Media3 and a foreground service on Android.
  • App shell. Permissions, lifecycle, the lock-screen controls and the manifest.

The shared code talks to these through small interfaces, so the player does not know which phone it is on. That is the whole trick: share everything above the line where the operating systems disagree, and keep the platform code thin and boring.

What surprised me

  1. The hosts are small. The iOS app is 1,137 lines of Swift. Most of it is bridges to Apple frameworks, plus the app entry point.
  2. The hard bugs were platform behavior, not shared logic. The one real Android bug, a speech error about "insufficient permission", turned out to be that Google's on-device speech service wants the microphone permission even when you hand it a file. The fix was a permission request in the Android host. No amount of shared code would have found it.
  3. iOS release plumbing still bites. Apple rejected my first build of this version because a bundled library, ONNX Runtime, declared a minimum iOS version that did not match the app. That is a native toolchain problem hiding under a cross-platform app, and cross-platform does not remove it.

Should you do this?

If your app is mostly logic, data, audio and a custom interface, I think the answer is yes, and a number like 82% is realistic. If your app is mostly platform features, such as widgets, deep system integration or heavy use of one framework, the shared layer shrinks and the case gets weaker for migrating to KMP.

For Buen Día, the payoff is that the interface, the player and the learning logic exist once, and both phones get them. The platform-specific work is the small, well-bounded part, and that is where the bugs I hit actually lived.

Buen Día is on the App Store ↗, and the Android version is in review on Google Play. You can follow it at buendia.dyor.com ↗.

Matt Dyor
by Matt Dyor
More Posts
It Took Two Tries to Get Buen Día onto Google Play

It Took Two Tries to Get Buen Día onto Google Play ↗

Google rejected Buen Día for freezing on a low-memory review device. Here's what we changed, the timeline, and how long each build took.

Published Nov 21, 2026

30,000 Lines in Two Weeks: Massive Changes in the Hunt for Product-Market Fit

30,000 Lines in Two Weeks: Massive Changes in the Hunt for Product-Market Fit ↗

Golf Sparks 1.1 added about 30,000 lines of app, web and backend code in two weeks, roughly a quarter of the whole codebase, and it reached both stores the same night. A new batch is already waiting. This is the new normal.

Published Nov 15, 2026

Simplified Startup Business Framework: CP Squared, Revisited for the AI Era

Simplified Startup Business Framework: CP Squared, Revisited for the AI Era ↗

In 2016 I wrote a one-page framework for early startups: Customer, Pain, Competition, Product. Now that AI lets anyone build anything, it matters more, because the scarcity is a problem worth solving.

Published Nov 13, 2026

Appos: Operator, Runner, Publisher, and Tiny Projects in One Window

Appos: Operator, Runner, Publisher, and Tiny Projects in One Window ↗

I took four standalone Mac apps for building and shipping mobile apps and put them in one window. Appos is a single project list with Run, Publish, and Tasks one click away, and each tool still works on its own.

Published Nov 10, 2026

Going to Production on Google Play and the App Store

Going to Production on Google Play and the App Store ↗

What it actually took to take Golf Sparks from testers to production review on both stores in one weekend: payments you can test before launch, the store-console forms that block you, and a short checklist.

Published Nov 2, 2026

How I Work with Operator, Runner, Publisher, and Tiny Projects

How I Work with Operator, Runner, Publisher, and Tiny Projects ↗

A walkthrough of Operator, Runner, Publisher, and Tiny Projects: the small Mac apps I use to organize projects, build and test mobile apps, handle releases, and keep follow-up work visible.

Published Oct 30, 2026

Page generated at: 2026-11-21T23:28:33.029Z