Port over iOS SwiftUI app

SwiftCrossUI is unique (as far as I'm aware) in that it supports every major desktop and mobile operating system while using native widgets.

To answer your questions:

  • Production use: Video Village is using SwiftCrossUI in production on Linux (and soon Windows)
  • Using new SwiftUI APIs: SwiftCrossUI has to manually implement each new API that SwiftUI introduces. So yeah, if you want to use new SwiftUI APIs you'd have to implement or request them, and that could take a while for more complicated features. On the other hand, if the feature is just a convenience API then usually you only have to add it in one place because SwiftCrossUI uses a backend abstraction layer and implements the developer-facing API surface on top of that abstraction layer, avoiding duplication.
  • Persistence frameworks: @MiaKoring recently released Amethyst Vein, a data persistence library with support for both SwiftCrossUI and SwiftUI under the hood. It's backed by sqlite
  • Android-specific libraries: SwiftCrossUI goes hand in hand with Swift Bundler, a bundling tool that can produce MSI installers for Windows, APKs for Android, .apps for Apple platforms, etc. That's where support for custom Android-specific libraries would go. We don't support it yet but it is something that has been requested. In my opinion it should be relatively easy to implement, I just haven't had a proper reason to invest time in that yet. If you'd like to try out SwiftCrossUI + Swift Bundler I'd be happy to hack up a proof of concept of that feature at some point.
  • Accessing platform APIs: SwiftCrossUI doesn't come with a platform abstraction (...yet). It's something that I want to look into eventually but it'd be a pretty large undertaking and I'm already busy enough with SwiftCrossUI and Swift Bundler. For now, the best approach is to use PureSwift/Android (moreSwift's fork of that more specifically) which gives you access to most Android system APIs from Swift via JNI. For example, here are their bindings for LocationManager. You'd then have to implement your platform integrations once for each platform that you support. It's not the best, but I don't think there's anything better if you're targeting iOS + Android + Windows.

I should add that SwiftCrossUI's primary focus has been desktop since the start. Our iOS and Android backends are our two newest backends. We'd love to focus more on getting our mobile support up to scratch, but the project only has one paying client at the moment, and their needs are on the desktop as well, so work on the mobile backends is mostly in my free time (and the free time of SwiftCrossUI's wonderful open source contributors).

If you're only targeting mobile, then Skip's the production ready solution. If you're targeting mobile and desktop, then there's no perfect solution, but I believe that SwiftCrossUI is the furthest along if you want to write cross platform applications that use native UI components under the hood in Swift.

Swift Bundler will also need a bit more work in order to support distributing apps on the Google Play Store as well.

4 Likes