Library / SDK
moreSwift/swift-cross-ui avatar
moreSwift/swift-cross-ui

SwiftCrossUI: Cross-Platform SwiftUI-Style Apps

A cross-platform declarative UI framework, inspired by SwiftUI.

1,780 stars97 forksSwiftMIT

At a glance

What is it?
SwiftCrossUI gives Swift 5.10 applications a declarative, SwiftUI-inspired interface layer across Apple, Windows, Linux, and Android systems. Its backend abstraction supports shared code, while incomplete feature parity and work-in-progress documentation make backend-specific checks essential.
Who is it for?
SwiftCrossUI is a reasonable fit for Swift 5.10 teams sharing declarative interface code across macOS, iOS, tvOS, Windows, Linux, or Android. It is a poor fit when every feature must have identical cross-platform behavior or when the framework must match SwiftUI exactly.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 23 days ago.
What is it written in?
Mainly Swift, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

SwiftCrossUI's Cross-Platform SwiftUI Alternative

SwiftCrossUI addresses a specific gap in Swift application development: developers who want to express a user interface in Swift can reuse that structure across operating systems instead of binding the entire application to Apple's SwiftUI framework. It targets Swift 5.10 or later and presents familiar constructs such as an App, a Scene, views, buttons, text, layout containers, and mutable state. The README describes it as "A SwiftUI-like framework for creating cross-platform apps in Swift."

The intended audience is Swift developers building desktop or mobile applications for several native platforms, especially teams that value a shared Swift interface layer but do not expect every platform-specific capability to behave identically. The repository identifies AppKit, UIKit, GTK, WinUI, and Android as its native platform foundations. Its goal is native appearance on each operating system, not a pixel-identical imitation of one platform's controls.

SwiftCrossUI deliberately does not reproduce the SwiftUI API perfectly. The README gives the reason: full replication would track a moving target and would carry over Apple-centric concepts. That boundary matters for adoption. Existing SwiftUI code may provide a useful starting point, but engineers should treat SwiftCrossUI as its own framework rather than assuming that code can move between the two without review.

Declarative State and Native Backend Flow

The basic example establishes a small data flow from state to interface. An App declares a counter with `@State`, creates a `WindowGroup`, and places a button, text, and horizontal layout inside the window body. Each button closure changes `count`, after which the `Text` view renders its new value. This is a declarative relationship rather than a collection of manually managed controls: the body describes the desired interface using the current value of `count`.

Platform integration happens through imported backend products. The package manifest example depends on both `SwiftCrossUI`, which supplies the framework interface, and `DefaultBackend`, which selects the native implementation for the target. `DefaultBackend` maps macOS to `AppKitBackend`, Windows to `WinUIBackend`, Linux to `GtkBackend`, Android to `AndroidBackend`, and iOS and tvOS to `UIKitBackend`.

That indirection makes shared Swift code possible, but it does not make every backend interchangeable. The README says `AppKitBackend` supports all SwiftCrossUI features. UIKit, Android, WinUI, GTK, and GTK 3 backends support most features. `GtkBackend` requires GTK 4, while `Gtk3Backend` targets older Linux distributions and requires GTK 3. The README also warns that `Gtk3Backend` is buggy on macOS because of bugs in GTK 3 itself.

Running CounterExample on Each Target

The repository's documented development path starts by cloning the project and changing into its `Examples` directory. The README says running examples requires Swift Bundler and points new users to that project's official installation instructions. Swift Bundler provides consistent behavior across platforms and can run examples on iOS, tvOS, and Android devices or their simulators and emulators.

The following commands come directly from the README. They fetch the repository, enter the example workspace, and run `CounterExample` on the host machine:

sh
git clone https://github.com/moreSwift/swift-cross-ui
cd swift-cross-ui/Examples
swift-bundler run CounterExample

For deployment to a connected device whose name contains `iPhone`, use the device command documented for macOS. The README also states that this mode supports Android devices:

sh
swift-bundler run CounterExample --device iPhone

For a simulator named `iPhone 16`, the README documents a separate simulator selector and says Android emulators are supported as well:

sh
swift-bundler run CounterExample --simulator "iPhone 16"

The exact device or simulator must already exist and must match the name passed on the command line. The README also gives `swift run CounterExample` as a non-recommended SwiftPM alternative. It warns that resources may not load correctly, deep linking may fail, and the SwiftPM route cannot run examples on iOS or tvOS. A real application should therefore start with Swift Bundler rather than using the fallback by default.

Package Integration and Backend Selection

The README's basic application uses Swift Package Manager. Its manifest declares the SwiftCrossUI package from `https://github.com/moreSwift/swift-cross-ui`, uses the `SwiftCrossUI` product, and imports `DefaultBackend`. The application entry point imports both modules and defines an `@main` App whose body returns a `WindowGroup`.

The README recommends `DefaultBackend` unless a project has a particular constraint. That makes it the sensible first backend to evaluate because it chooses the native adapter for each operating system. A team can move to a platform-specific backend only when it needs behavior that the default selection does not provide.

The documented package example requests `0.2.0` with an up-to-next-minor rule, although the release list also records `v0.8.0`, `v0.9.0`, and `v0.10.0`. That mismatch is a concrete upgrade warning. A new package should not copy the old version range blindly. It should consult the quick start guide and release information, then choose a version that fits the current API. The README does not document a migration or rollback procedure for framework upgrades.

Feature Parity, Native Constraints, and Alternatives

The clearest limitation is uneven backend support. `AppKitBackend` is described as supporting every SwiftCrossUI feature, while the other listed backends support most features. No compatibility table appears in the README, so developers cannot confirm a particular control or scene behavior from this information alone. A cross-platform interface may compile into shared Swift code and still require platform-specific decisions at packaging, resource loading, linking, or feature-selection stages.

GTK also introduces an operating-system dependency outside Swift Package Manager. `GtkBackend` requires GTK 4 on Linux, macOS, and Windows. `Gtk3Backend` exists for older Linux distributions but is described as buggy on macOS. The repository's `Dockerfile` uses `swift:latest` and installs `libgtk-3-dev` and `clang`, but it is a development container definition, not a complete application deployment guide. The README does not provide production packaging commands for each platform.

A real alternative is SwiftUI when the application targets Apple platforms. SwiftUI uses Apple's native framework directly, while SwiftCrossUI introduces its own view and scene API plus a backend abstraction. Apple-only projects avoid the portability layer and its incomplete cross-backend parity, but they give up SwiftCrossUI's stated goal of sharing interface code with Windows, Linux, and Android. Another approach is writing separate native UI layers, which preserves direct platform access but duplicates application structure and increases maintenance work.

Release Cadence, MIT Terms, and Upgrade Work

The repository is not archived. Its last push was on 2026-09-30, and releases include `v0.10.0` on 2026-09-30, `v0.9.0` on 2026-08-19, and `v0.8.0` on 2026-07-02. These dates show several releases across the middle and latter part of 2026. They do not establish API stability, and the README continues to call the project a work in progress with proper documentation and tutorials still to come.

That leaves an explicit maintenance cost for adopters: each release may require checking package rules, backend behavior, and example changes. The project uses semantic version labels, but the README does not promise compatibility guarantees between minor or major releases. Its package example remains on `0.2.0`, so upgrade examples in the README may lag current releases.

The repository uses the MIT license. That permits use, modification, distribution, and sublicensing subject to the license conditions, while the README does not offer legal interpretation. Teams that copy code into proprietary applications should preserve the required license notice and inspect `LICENSE` and the repository's `Acknowledgements/` directory as part of their release process.

Editorial conclusion

SwiftCrossUI is a reasonable fit for Swift 5.10 teams sharing declarative interface code across macOS, iOS, tvOS, Windows, Linux, or Android. It is a poor fit when every feature must have identical cross-platform behavior or when the framework must match SwiftUI exactly. Before adoption, inspect the backend documentation for each required platform, verify the feature under consideration against the current release, and confirm that the selected GTK or native toolchain meets deployment requirements.

Frequently asked questions

Which platforms does SwiftCrossUI support?

SwiftCrossUI has backends for macOS, iOS, tvOS, Windows, Linux, and Android. `DefaultBackend` selects AppKit, UIKit, WinUI, GTK, or Android according to the target operating system.

How do I run the first SwiftCrossUI example?

Clone the repository, change into `swift-cross-ui/Examples`, and run `swift-bundler run CounterExample`. The README requires Swift Bundler for the recommended example workflow.

Does SwiftCrossUI have the same API as SwiftUI?

No. Its views and scenes share part of SwiftUI's API surface, but the project explicitly does not attempt to reproduce every SwiftUI API or Apple-specific concept.

Official sources

  1. License: MIT
  2. moreSwift/swift-cross-ui on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/moreswift-swift-cross-ui.svg)](https://hysenlabs.com/projects/moreswift-swift-cross-ui)

Was this useful?