Skip to content

OpenSwiftUIProject/OpenSwiftUI

Repository files navigation

OpenSwiftUI

codecov

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.

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

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.

Build

The current suggested toolchain to build the project is Swift 6.1 / Xcode 16.3.

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 tools like EnvPane or MenuHelper on macOS platform to manage the environment variable more easily.

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 Compatibility tests
UI Tests UI Tests

Platform Support

Platform CI Status Support Status Build Test Deploy
macOS macOS ⭐️⭐️⭐️ *1
iOS iOS ⭐️⭐️⭐️⭐️ *2
Ubuntu 22.04 Ubuntu ⭐️⭐️ *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.

Products

  • 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.

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.

Part of the header file is from Apple Open Source project which is license under APSL

Star History

Star History Chart

Footnotes

  1. AppKit intergration is partly implemented. Render is support via SwiftUI's render implementation. Other UI framework backend is not intergrated yet.

  2. UIKit intergration is partly implemented. Render is support via SwiftUI's render implementation.

  3. Build and test is supported. But some feature is cut due to known Swift compiler issue.