This guide walks you through the steps to integrate OpenSwiftUI into your project.
- Xcode 16.4
- Swift 6.1.2+
- macOS 15.5 (for macOS apps) or iOS 18.5 (for iOS apps)
Warning
OpenSwiftUI uses private Apple APIs and frameworks - NOT for App Store distribution.
These private frameworks are ONLY for research and educational purposes.
Due to the use of unsafeFlags in the build configuration, you cannot use tagged releases (like 0.10.0). Instead, you must specify either a branch or a revision dependency.
Add the following to your Package.swift:
dependencies: [
.package(url: "https://github.com/OpenSwiftUIProject/OpenSwiftUI.git", branch: "main"),
]To use a specific commit or tag revision:
dependencies: [
.package(url: "https://github.com/OpenSwiftUIProject/OpenSwiftUI.git", revision: "97347dadc"),
]You can find the revision hash by checking the commit you want to use on GitHub.
- In your Xcode project, go to File → Add Package Dependencies...
- Enter the repository URL:
https://github.com/OpenSwiftUIProject/OpenSwiftUI.git - Select "Branch" and enter
main(or select "Commit" and enter a specific revision) - Click Add Package
When building for Darwin platforms, you will likely encounter xcframework-related issues. You need to manually add the required private frameworks from DarwinPrivateFrameworks to your target.
Note
Why This Is Needed?
OpenSwiftUI depends on private frameworks like AttributeGraph that are not publicly available.
The DarwinPrivateFrameworks package provides these as xcframeworks, but they need to be manually configured in Xcode to avoid runtime issues.
After adding OpenSwiftUI as a dependency, the DarwinPrivateFrameworks package will be downloaded automatically.
In Xcode's Project Navigator:
- Find Package Dependencies → DarwinPrivateFrameworks
- Right-click on DarwinPrivateFrameworks and select Show in Finder
In Finder, you'll see the xcframework files (e.g., AG/2024/AttributeGraph.xcframework).
Drag the required xcframework(s) into your Xcode project's target:
- Select your app target in Xcode
- Go to the General tab
- Scroll to Frameworks, Libraries, and Embedded Content section
- Drag the xcframework files from Finder into this section
- Important: Set the embed option to Do Not Embed
This tells Xcode to link against the frameworks without embedding them, which is necessary for private SDK usage on macOS.
The following xcframeworks are typically needed:
- AttributeGraph.xcframework - From
AG/2024/directory - Other frameworks as needed based on your OpenSwiftUI usage
For more details, see the DarwinPrivateFrameworks README.
Once you've completed the integration steps above, you can import and use OpenSwiftUI in your Swift files just like you would import SwiftUI:
import OpenSwiftUI
struct ContentView: View {
var body: some View {
VStack {
Color.red
Color.blue
}
}
}Note
Only some APIs and View types are currently supported.
OpenSwiftUI has full debug support for development and troubleshooting. You can use breakpoints, inspect variables, and debug your views just like with SwiftUI.
Note
Xcode Preview support is currently under development and will be available in a future release.
The current supported platforms are macOS and iOS simulators. (visionOS simulator is also supported but not tested extensively and there is no CI for it yet.)
Currently, AttributeGraph is missing some symbols for iOS device. Until OpenAttributeGraph is ready, this platform is not supported.
Affected platforms:
- iOS device builds (iPhone, iPad)
Workaround: Use iOS Simulator for development and testing.
Future resolution: This limitation will be lifted when OpenAttributeGraph is ready, which will unlock iOS device platform support.
Current supported ABI versions:
- iOS 18.5
- macOS 15.5
Impact: Your target platform deployment version must match these specific versions to avoid runtime compatibility issues.
Future resolution: This limitation will be lifted when OpenSwiftUI's own Render engine (ViewUpdater) is ready, which will remove the ABI version lock requirement and allow broader platform version support.
If you see errors like:
AttributeGraph.framework has missing or invalid CFBundleExecutable in its Info.plist
Make sure you've added the AttributeGraph.xcframework to your target and set it to "Do Not Embed".
If Xcode fails to resolve the package:
- Make sure you're using
branch: "main"or a specificrevision:instead of a version tag - Try File → Packages → Reset Package Caches
- Clean the build folder (Shift+Cmd+K) and rebuild



