OpenSwiftUI
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
[!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.
Notes
this project is for learning and research purposes only.
If you choose to use this project, you do so at your own risk and are responsible for compliance with any applicable laws.
The author of this project is not responsible for any consequences that may arise from your use of this project.
[!WARNING]
This package use a lot of hidden API and private framework on Apple platform.
> Please DO NOT use this package in Apple's production environment(eg. App Store).
Otherwize it may break your build or crash your app at any future SDK/OS update.
Usage
Integration Guide
To integrate OpenSwiftUI into your own Xcode project, see INTEGRATION.md for detailed step-by-step instructions.
Example Application
See Example folder and try it with ExampleApp
[!IMPORTANT]
Clone OpenAttributeGraph in the same directory before running the example.
> See Example/README.md for more detail.
Build
The current suggested toolchain to build the project is Swift 6.3.3 / Xcode 26.6.
Build without testing framework
./Scripts/build
Build with Library Evolution
./Scripts/openswiftui_swiftinterface
[!NOTE]
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
Supported platforms
The table below describes the current level of support that OpenSwiftUI has
for various platforms:
Darwin Platform Status
| Test Type | CI Status |
|-|:-|
| SwiftUI Compatibility | |
| UI Tests |
|
| Interaction Tests |
|
Platform Support
| Platform | CI Status | Support Status | Build | Test | Deploy | Owner |
|-|:-|-|-|-|-|-|
| macOS | | ⭐️⭐️⭐️ *[^1] | ✅ | ✅ | ✅ | @Kyle-Ye, @Mx-Iris |
| iOS |
| ⭐️⭐️⭐️⭐️ *[^2] | ✅ | ✅ | ✅[^5] | @Kyle-Ye |
| Ubuntu 22.04 |
| ⭐️⭐️ *[^3] | ✅ | ✅ | ✅[^3] | @Kyle-Ye |
| visionOS |
| ⭐️ *[^4] | ✅ | Not tested in CI | ✅[^4] | @Kyle-Ye |
| Android | None | Not supported yet | ❌ | ❌ | ❌ | |
| Windows | None | Not supported yet | ❌ | ❌ | ❌ | |
| Embedded | None | Preview[^6] | ✅ | ✅ | ✅ | @Kyle-Ye |
[^1]: AppKit integration is partially implemented.
[^2]: UIKit integration is partially implemented.
[^3]: Build, test, and deployment with the stdout renderer are supported. Linux UI framework integration is not available yet.
[^4]: 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.
[^5]: iOS Simulator is supported. iOS device builds require the Compute backend. Apple's AttributeGraph backend is limited to the simulator because required device symbols are missing.
[^6]: Build and host tests are supported on the embed/folotoy branch. For the ESP32-C3 deployment example, see OpenSwiftUI on ESP32-C3.
[!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.
Current supported features
- Color/Image/Path rendering
Textlayout and rendering on Darwin, including rich attributes and attachments- Text localization and formatted text (
LocalizedStringKey,FormatStyle,
- Layout system
- Animation system
- Gesture system, including composition, state, hit testing, and UIKit/AppKit integration
- onAppear/onDisappear modifier
- Basic geometry effect
Architecture
Products
- OpenSwiftUI
- OpenSwiftUIExtension
- OpenSwiftUIBridge
Versioned documentation
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.sh
See Docs/Documentation.md for configuration, caching, and release details.
Contributing
Contributions are welcome. See CONTRIBUTING.md for development setup, testing guidance, and pull request expectations.
Disclaimer
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.
License
This project is licensed under the MIT License. See the LICENSE file for details.
For third-party licenses and acknowledgements, see CREDITS.md.