Swift finally has official Android support (in preview) — a milestone that opens up exciting new possibilities for developers working across iOS and Android.

I looked into Swift for Android about five years ago when exploring ways to share business logic between iOS and Android apps, and it’s great to see how far the SDK has come. I remember setup being a real hassle back then. Now, with swiftly, it’s just a matter of installing the correct tool versions.

Sharing business logic across platforms

If you have non-UI logic that you want to share across platforms, this could become a real option once it is out of preview.

  • 25% of packages on the Swift Package Index already build for Android out of the box
  • Communication happens via the JNI, which can introduce its own quirks when passing data
  • This is for business logic only, not UI reuse

From C++ to Swift

Back when I wrote my master’s thesis, I concluded that transpiling Swift into Kotlin was the most viable path for sharing business logic between platforms. Today, with Swift for Android, there are more ways to cross-compile binaries from the same shared source.

Keeping the UI native is actually a feature to your users: You still deliver 100% native UIs, without depending on cross-platforms frameworks to stay up to date.

It’s great to see how far we’ve come since the days of sharing logic in C++.