A cross-platform declarative UI framework, inspired by SwiftUI.
See the code
A SwiftUI-like framework for creating cross-platform apps in Swift (5.10+).
To get started with SwiftCrossUI, check out the quick start guide.
[!NOTE] SwiftCrossUI does not attempt to replicate SwiftUI's API perfectly since that would be a constantly-moving target and SwiftUI has many entrenched Apple-centric concepts. That said, SwiftCrossUI's built-in views and scenes share much of their API surface with their SwiftUI cousins, and over time SwiftCrossUI will likely adopt many of SwiftUI's commonly-used APIs.
Discussion about SwiftCrossUI happens in the moreSwift Discord server. Join to discuss the library, get involved, or just be kept up-to-date on progress!
If you find SwiftCrossUI useful, please consider supporting its development by becoming a sponsor. moreSwift's core contributors spend much of their spare time working on open-source projects, and each sponsorship helps us to focus more time on making high quality tools and libraries for the community.
Here's the documentation site. SwiftCrossUI is still a work-in-progress; proper documentation and tutorials are on the horizon. Documentation contributions are very welcome!
Here's a simple example app demonstrating how easy it is to get started with SwiftCrossUI. For a more detailed walkthrough, check out our quick start guide
import PackageDescription
let package = Package(
name: "YourApp",
dependencies: [
.package(
url: "https://github.com/moreSwift/swift-cross-ui",
.upToNextMinor(from: "0.2.0")
),
],
targets: [
.executableTarget(
name: "YourApp",
dependencies: [
.product(name: "SwiftCrossUI", package: "swift-cross-ui"),
.product(name: "DefaultBackend", package: "swift-cross-ui"),
]
),
]
)
Figure 1: Package.swift
import SwiftCrossUI
import DefaultBackend
@main
struct YourApp: App {
@State var count = 0
var body: some Scene {
WindowGroup("YourApp") {
HStack {
Button("-") { count -= 1 }
Text("Count: \(count)")
Button("+") { count += 1 }
}.padding()
}
}
}
Figure 2: Sources/YourApp/YourApp.swift
The SwiftCrossUI repository contains the above example and many more. The documentation hosts a detailed list of all examples.
Running the examples requires Swift Bundler, which provides consistent behavior across platforms and enables running on iOS/tvOS/Android devices and simulators/emulators.
To install Swift Bundler, follow its official installation instructions.
git clone https://github.com/moreSwift/swift-cross-ui
cd swift-cross-ui/Examples
# Run on host machine
swift-bundler run CounterExample
# Run on a connected device with "iPhone" in its name (macOS only)
# Supports Android devices as well
swift-bundler run CounterExample --device iPhone
# Run on a simulator with "iPhone 16" in its name (macOS only)
# Supports Android emulators as well
swift-bundler run CounterExample --simulator "iPhone 16"
These examples may also be run using SwiftPM. However, resources may not be loaded as expected, and features such as deep linking may not work. You also won't be able to run the examples on iOS or tvOS using this method.
# Non-recommended method
swift run CounterExample
SwiftCrossUI has a variety of backends tailored to different operating systems. The beauty of SwiftCrossUI is that you can write your app once and have it look native everywhere. For this reason I recommend using DefaultBackend unless you've got particular constraints.
[!TIP] Click through each backend name for detailed system requirements and installation instructions.
[!TIP] If you're using DefaultBackend, you can override the underlying backend during compilation by setting the
SCUI_DEFAULT_BACKENDenvironment variable to the name of the desired backend. This is useful when you e.g. want to test the Gtk version of your app while using a Mac. Note that this only works for built-in backends and still requires the chosen backend to be compatible with your machine.
(top 24 of 57)
579 followers · starred Dec 2025
106 followers · starred Oct 2023
958 followers · starred Sep 2026
664 followers · starred Mar 2026
A cross-platform declarative UI framework, inspired by SwiftUI.
See the code
A SwiftUI-like framework for creating cross-platform apps in Swift (5.10+).
To get started with SwiftCrossUI, check out the quick start guide.
[!NOTE] SwiftCrossUI does not attempt to replicate SwiftUI's API perfectly since that would be a constantly-moving target and SwiftUI has many entrenched Apple-centric concepts. That said, SwiftCrossUI's built-in views and scenes share much of their API surface with their SwiftUI cousins, and over time SwiftCrossUI will likely adopt many of SwiftUI's commonly-used APIs.
Discussion about SwiftCrossUI happens in the moreSwift Discord server. Join to discuss the library, get involved, or just be kept up-to-date on progress!
If you find SwiftCrossUI useful, please consider supporting its development by becoming a sponsor. moreSwift's core contributors spend much of their spare time working on open-source projects, and each sponsorship helps us to focus more time on making high quality tools and libraries for the community.
Here's the documentation site. SwiftCrossUI is still a work-in-progress; proper documentation and tutorials are on the horizon. Documentation contributions are very welcome!
Here's a simple example app demonstrating how easy it is to get started with SwiftCrossUI. For a more detailed walkthrough, check out our quick start guide
import PackageDescription
let package = Package(
name: "YourApp",
dependencies: [
.package(
url: "https://github.com/moreSwift/swift-cross-ui",
.upToNextMinor(from: "0.2.0")
),
],
targets: [
.executableTarget(
name: "YourApp",
dependencies: [
.product(name: "SwiftCrossUI", package: "swift-cross-ui"),
.product(name: "DefaultBackend", package: "swift-cross-ui"),
]
),
]
)
Figure 1: Package.swift
import SwiftCrossUI
import DefaultBackend
@main
struct YourApp: App {
@State var count = 0
var body: some Scene {
WindowGroup("YourApp") {
HStack {
Button("-") { count -= 1 }
Text("Count: \(count)")
Button("+") { count += 1 }
}.padding()
}
}
}
Figure 2: Sources/YourApp/YourApp.swift
The SwiftCrossUI repository contains the above example and many more. The documentation hosts a detailed list of all examples.
Running the examples requires Swift Bundler, which provides consistent behavior across platforms and enables running on iOS/tvOS/Android devices and simulators/emulators.
To install Swift Bundler, follow its official installation instructions.
git clone https://github.com/moreSwift/swift-cross-ui
cd swift-cross-ui/Examples
# Run on host machine
swift-bundler run CounterExample
# Run on a connected device with "iPhone" in its name (macOS only)
# Supports Android devices as well
swift-bundler run CounterExample --device iPhone
# Run on a simulator with "iPhone 16" in its name (macOS only)
# Supports Android emulators as well
swift-bundler run CounterExample --simulator "iPhone 16"
These examples may also be run using SwiftPM. However, resources may not be loaded as expected, and features such as deep linking may not work. You also won't be able to run the examples on iOS or tvOS using this method.
# Non-recommended method
swift run CounterExample
SwiftCrossUI has a variety of backends tailored to different operating systems. The beauty of SwiftCrossUI is that you can write your app once and have it look native everywhere. For this reason I recommend using DefaultBackend unless you've got particular constraints.
[!TIP] Click through each backend name for detailed system requirements and installation instructions.
[!TIP] If you're using DefaultBackend, you can override the underlying backend during compilation by setting the
SCUI_DEFAULT_BACKENDenvironment variable to the name of the desired backend. This is useful when you e.g. want to test the Gtk version of your app while using a Mac. Note that this only works for built-in backends and still requires the chosen backend to be compatible with your machine.
(top 24 of 57)
579 followers · starred Dec 2025
106 followers · starred Oct 2023
958 followers · starred Sep 2026
664 followers · starred Mar 2026