OpenSwiftUI is an open source implementation of Apple's SwiftUI
The project is for the following purposes:
- Build GUI app on non-Apple platform (eg. Linux & Windows)
- Diagnose and debug SwiftUI issues on Apple platform
And the API design and documentation is to stay as compatible with the original SwiftUI API as possible.
Tip
"Why join the navy if you can be a pirate?" — Steve Jobs
:)
Currently, this project is in early development.
The full API documentation is available on the OpenSwiftUI documentation site.
Warning
This package uses private APIs and frameworks on Apple platforms. DO NOT ship it to production (e.g. the App Store), as future SDK or OS updates may break builds or crash at runtime. Use at your own risk; see Disclaimer.
To integrate OpenSwiftUI into your own Xcode project, see INTEGRATION.md for detailed step-by-step instructions.
See Example/README.md to set up local dependencies and generate Example.xcworkspace.
The current suggested toolchain to build the project is Swift 6.3.3 / Xcode 26.6.
./Scripts/build.sh./Scripts/build_swiftinterface.shNote
This project's configuration is heavily based on many environment variables.
You can use the following tools on macOS platform to manage the environment variable more easily.
- EnvPane: A macOS preference pane for environment variables
- MenuHelper: A Finder Extension App to improve your efficiency.
- launchctl via
Scripts/sync_launchagent.sh
The table below describes the current level of support that OpenSwiftUI has
for various platforms:
| Test Type | CI Status |
|---|---|
| SwiftUI Compatibility | |
| UI Tests | |
| Interaction Tests |
| Platform | CI Status | Support Status | Build | Test | Deploy | Owner |
|---|---|---|---|---|---|---|
| macOS | ⭐️⭐️⭐️ *1 | ✅ | ✅ | ✅ | @Kyle-Ye, @Mx-Iris | |
| iOS | ⭐️⭐️⭐️⭐️ *2 | ✅ | ✅ | Simulator, devices with Compute | @Kyle-Ye | |
| Ubuntu 22.04 | ⭐️⭐️ *3 | ✅ | ✅ | ✅3 | @Kyle-Ye | |
| visionOS | ⭐️ *4 | ✅ | Not tested in CI | ✅4 | @Kyle-Ye | |
| Android | None | Preview (android/dev) |
✅ | Manual emulator smoke tests | arm64 APK (API 28+) | @Kyle-Ye |
| WASI | None | Preview (wasi/dev) |
✅ | Browser gesture smoke tests | Static web bundle | @Kyle-Ye |
| Windows | None | Not supported yet | ❌ | ❌ | ❌ | |
| Embedded | None | Preview (embed/folotoy) |
✅ | Host tests | ESP32-C3 | @Kyle-Ye |
Note
The cross-platform OpenAttributeGraph is not fully implemented.
The Linux stdout example uses the Compute backend to run its view graph.
Note
To request platform ownership, please first contribute to the target platform and then contact the project owner.
- Color, image, and path rendering, including gradient fills on Darwin
Textlayout and rendering on Darwin, including rich attributes and attachments- Text localization and formatted text (
LocalizedStringKey,FormatStyle, dates, timers, and formatters) - Layout system
- Animation system
- Gesture system, including composition, state, hit testing, and UIKit/AppKit integration
- onAppear/onDisappear modifier
- Basic geometry effect
Text support varies by renderer. See SwiftUI Compatibility Gaps
for the limits on main and the platform preview branches.
- OpenSwiftUI
- A SwiftUI source compatibility framework.
- OpenSwiftUIExtension
- Extensive API collections for OpenSwiftUI & SwiftUI.
- OpenSwiftUIBridge
- A bridge layer for migrating other DSL framework to OpenSwiftUI incrementally and mixing them freely.
The documentation site is built with
VersionedDocC and automatically
tracks main and recent release series. It provides version switching, build
dates, and API change comparisons.
Build and preview the site locally with:
Scripts/preview-documentation.shSee Docs/Documentation.md for configuration, caching, and release details.
Contributions are welcome. See CONTRIBUTING.md for development setup, testing guidance, and pull request expectations.
SwiftUI is a trademark of Apple Inc. This project is not affiliated with, endorsed by, or connected to Apple Inc. in any way. OpenSwiftUI is an independent open-source implementation created for educational and research purposes.
This project is licensed under the MIT License. See the LICENSE file for details.
For third-party licenses and acknowledgements, see CREDITS.md.
Footnotes
-
AppKit integration is partially implemented. ↩
-
UIKit integration is partially implemented. ↩
-
Build, test, and deployment with the stdout renderer are supported. Linux UI framework integration is not available yet. ↩ ↩2
-
visionOS support is experimental. Builds for visionOS devices and the visionOS Simulator need a UIKit header overlay. See visionOS Build. CI builds for the visionOS Simulator but does not run tests. ↩ ↩2
