I started AnywhereRoles in 2020 as an iPhone app. Today it runs on iPhone, Android and the web. Android and iPhone share one Kotlin Multiplatform module. This is a short note about where I drew the line between shared code and native code, and the things that hurt.
What is shared
The shared module holds the domain rules, the data layer and the ViewModels. That means the database, the network client, the repositories, the use cases and the screens' state. Dependency injection is Koin. Android shows the state with Jetpack Compose. The iPhone app shows the same state with SwiftUI, through small bridge classes.
The most useful rule I follow: if two platforms must give the same answer, the rule lives in shared code. A few examples.
One job card says "Posted 2 d ago, checked 3 h ago". The decision of what to show is one shared function. Each platform only turns the ages into words with its own date formatter. Before that, the two apps sometimes disagreed.
The small flag in front of a job location is one shared function too. It reads the free text, finds up to three countries, and decides between a flag, a globe or nothing. Both apps draw the result.
The paywall table is data in shared code. A row I add there shows up in both apps.
This sounds boring. It is the part that saved me the most time.
What stays native
Screens, navigation and anything that must feel like the platform. I did not try to share the UI. Android has its own navigation and large-screen layout. The iPhone app has its own sheets and share dialogs. A calendar event is created with the system calendar on Android and with the write-only calendar permission on iPhone. The shared code only builds the event text and length, so both apps agree.
Things that hurt
Tests for iOS do not run where you think. My Linux build checks that the iOS Kotlin code compiles, but it does not run the common tests for iOS. A change can pass everything and still break on a Mac. Now I run the iOS test task on a Mac for every change in the shared module.
Kotlin/Native is not the JVM. Two things bit me. A test name with a comma in backticks is fine on the JVM and rejected by Kotlin/Native. And a regex class that mixes a Unicode letter class with other characters did not behave the same way. Now there is a small script in the build that looks for both.
Swift is not built in my CI. A hosted Mac runner costs a lot more than a Linux one, so I removed it. I build and test the iPhone app on my own Mac before each release. The price is that a new Swift file can be forgotten in the project and nothing warns me until the upload step. I accept this for now.
What I would do differently
I would write the "shared rules" list at the start. I found most of them by fixing a bug where the platforms disagreed. I would also set up the Mac checks earlier.
If you want to see the result, it is free to browse: https://anywhereroles.com/?utm_source=devto&utm_medium=social&utm_campaign=nov_2026
I am also available for hire as an Android or Kotlin Multiplatform developer. Tell me what you would do differently in the comments. I read all of them.


