Skip to content

feat(XR): add visionOS Simulator UIKit header overlay - #77

Merged
Kyle-Ye merged 1 commit into
mainfrom
optimize/visionos
Oct 17, 2026
Merged

Kyle-Ye merged 1 commit into
mainfrom
optimize/visionos

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Oct 17, 2026

Copy link
Copy Markdown
Member

The public visionOS Simulator SDK marks UIScreen, UIWindow.screen, and UIDevice.orientation unavailable, although UIKit implements them at runtime. Add Scripts/XR/install_xr_uikit_overlay.sh, which copies UIScreen.h, UIWindow.h, and UIDevice.h from the selected XRSimulator SDK, removes those restrictions, and writes a clang and swift VFS overlay to ~/Library/Developer/OpenSwiftUI/XRSimulator. Projects use it through -ivfsoverlay and -vfsoverlay for xrsimulator; the SDK inside Xcode stays unchanged. The --sdk option also writes a UIKit-only additions SDK for projects that use ADDITIONAL_SDKS.

The header patch logic moves to Scripts/XR/patch_uikit_headers.sh, which checks that every expected restriction was removed. enable_uiscreen_support.sh remains as a wrapper for install_internal_sdk.sh XRSimulator. The README documents the overlay and marks the XRSimulator internal SDK path as legacy.

Verified with Xcode 26.6 and the visionOS 2.5 Simulator: OpenSwiftUI builds for generic/platform=visionOS Simulator (arm64 and x86_64) and its HostingExample runs. The patch also applies to the Xcode 16.4 and 27.0 headers.

Add install_xr_uikit_overlay.sh, which generates a clang and swift VFS
overlay that replaces UIScreen.h, UIWindow.h, and UIDevice.h of the
selected XRSimulator SDK with copies that allow UIScreen,
UIWindow.screen, and UIDevice.orientation on visionOS. The SDK inside
Xcode stays unchanged. The --sdk option also writes a UIKit-only
additions SDK for projects that use ADDITIONAL_SDKS.

Move the header patch logic into patch_uikit_headers.sh with
verification, and keep enable_uiscreen_support.sh as a wrapper for the
internal SDK installer. Document the overlay in the README and mark the
XRSimulator internal SDK path as legacy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant