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 is to stay the same as the original SwiftUI API as possible.
Currently, this project is in early development.
You can find the API documentation here.
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.
See Example folder and try it with ExampleApp
Important
Clone OpenGraph in the same directory before running the example.
See Example/README.md for more detail.
The current suggested toolchain to build the project is Swift 6.1 / Xcode 16.3.
./Scripts/build
./Scripts/openswiftui_swiftinterface
Note
This project's configuration is heavily based on many environment variables.
You can use tools like EnvPane or MenuHelper on macOS platform to manage the environment variable more easily.
The table below describes the current level of support that OpenSwiftUI
has
for various platforms:
Test Type | CI Status |
---|---|
SwiftUI Compatibility | |
UI Tests |
Platform | CI Status | Support Status | Build | Test | Deploy |
---|---|---|---|---|---|
macOS | ⭐️⭐️⭐️ *1 | ✅ | ✅ | ✅ | |
iOS | ⭐️⭐️⭐️⭐️ *2 | ✅ | ✅ | ✅ | |
Ubuntu 22.04 | ⭐️⭐️ *3 | ✅ | ✅ | ❌ | |
Windows | None | Not supported yet | ❌ | ❌ | ❌ |
Note
The cross-platform OpenGraph is not fully implemented.
It is only API compatible with AttributeGraph now.
So most of the core feature is only available on Apple platform built with AttributeGraph varient.
- 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.
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.
Part of the header file is from Apple Open Source project which is license under APSL
Footnotes
-
AppKit intergration is partly implemented. Render is support via SwiftUI's render implementation. Other UI framework backend is not intergrated yet. ↩
-
UIKit intergration is partly implemented. Render is support via SwiftUI's render implementation. ↩
-
Build and test is supported. But some feature is cut due to known Swift compiler issue. ↩