Comment by GeekyBear

Comment by GeekyBear 3 days ago

3 replies

Swift is a cross-platform compiled programming language that offers memory safety as a tentpole feature.

SwiftUI is a platform specific API for developers who are writing native apps for that platform.

You can think of Swift as being similar in concept to Rust and SwiftUI as being similar in concept to Win32.

wahnfrieden 3 days ago

SwiftUI is also now an API for writing Android native apps, too.

I don't know why you skipped over that part? It's maybe like when Google rewrote Java. Win32 is a bad comparison because there's no Win32-compatible API for native apps on other platforms (that I know of?) except for emulation, but the Android SwiftUI project is not using emulation, it runs the code natively and the result is native Android UI.

  • GeekyBear 3 days ago

    Apple has not released a version of the SwiftUI framework for Android.

    There are third party attempts to create something that lets SwiftUI code run on Android, just as Wine is third party software that allows you to run Win32 apps on Linux.

    For example:

    > Bringing Swift and SwiftUI to Android

    https://skip.tools/blog/bringing-swift-to-android/

    • wahnfrieden 3 days ago

      No one said it's first-party. And it's a good thing that it's not first-party! We want multiple options for deploying our code.

      As I said, Wine provides emulation. But the SwiftUI on Android project does not emulate - it runs your SwiftUI code natively (as Swift that is compiled for Android), and maps it to native Android components, fully accessible and meeting platform expectations.

      Completely different result and experience.

      This also means that you can extend the SwiftUI on Android code with Android-specific code that will not run on iOS, to add other Android-specific UI. This is impossible with Wine + Win32.