iOS and Android

I currently have a iOS app live on the App Store but I also want to release it on Android, the whole code is in Swift so would that be possible or would I have to rewrite my whole apps code in a different coding language.

Thanks for the great post.

That's a common and excellent question for iOS developers looking to expand to Android and hope there are many Android developers in the forums wanting to provide their opinion how they manage the 2 different technologies. Looking forward to see other people’s opinions as mine is based on my development experience.

I should be the last person to have an opinion about this based on my job. In my modest and personal opinion not being an Android developer, you will almost certainly need to rewrite the user interface of your app for Android. However, you might be able to reuse a significant portion of your app's core business logic, data models, and networking code written in Swift.

iOS Uses UIKit (older) or SwiftUI (newer) for building UIs. Android uses XML layouts with Views (older) or Jetpack Compose (newer) for building UIs. As far as I know there's no direct way to convert SwiftUI or UIKit code into Android XML/Compose, or vice-versa. The underlying rendering engines and component models are fundamentally different. Many of your app's interactions with the device (e.g., camera, GPS, notifications, file system, authentication) will use platform-specific APIs. While the concept is the same, the implementation in Swift for iOS is different from Kotlin/Java for Android.

I believe there are a few cross platforms tools I have seen during the years, I can’t recommend any at all as nothing will be as good as going native in my modest opinion.

3 cross platform tool I have seen, but I never recommend those as the native approach is always better:

  • Flutter
  • React Native
  • Xamarin, well MAUI now

Unless your Swift logic is incredibly complex and unique, making a rewrite prohibitive, I would generally lean towards native Android UI depending on your team's resources and comfort with Kotlin?

What other developers in the forums are recommending?

Albert Pascual
  Worldwide Developer Relations.

I have two options that you should at least look at:

  • If your goal is to run non-UI Swift code on Android then Swift’s Android Workgroup is making great strides on that front.
  • If you want to extend that to SwiftUI code, there’s a third-party vendor who’s tackling that directly [1].

And to be clear, I’m not actually recommending either of these, because I’ll only recommend stuff that I’ve actually used. But you should at least factor them into your decision making.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] https://skip.tools

iOS and Android
 
 
Q