Skip to content

fix(preview): add native visionOS Preview support - #1179

Merged
Kyle-Ye merged 2 commits into
mainfrom
feature/visionos_preview
Oct 18, 2026
Merged

Kyle-Ye merged 2 commits into
mainfrom
feature/visionos_preview

Conversation

@Kyle-Ye

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

Copy link
Copy Markdown
Member

Summary

  • Add a DeveloperToolsSupport.Preview initializer that takes an OpenSwiftUI view body and presents it as a SwiftUI view preview, so Xcode applies the platform canvas, such as the visionOS window canvas and camera controls.
  • Expand #Preview with a local view builder function, as SwiftUI does, instead of an extra Group.
  • Deprecate _previewVC() in favor of the #Preview macro or PreviewProvider.
  • Use canImport(Darwin) for Apple platform guards in the preview support and related files.
  • Update the preview documentation.

Part of #1171.

- Add a DeveloperToolsSupport.Preview initializer that takes an
  OpenSwiftUI view body and wraps it in a SwiftUI view, so Xcode applies
  the platform canvas, such as the visionOS window canvas.
- Expand #Preview with a local view builder function, as SwiftUI does,
  instead of an extra Group.
- Deprecate _previewVC().
@github-actions github-actions Bot added area: example Example apps, previews, sample projects, screenshots, or demo assets. platform: visionOS visionOS-specific behavior or support. type: feature New API, behavior, platform support, or user-facing capability. labels Oct 18, 2026
@Kyle-Ye Kyle-Ye changed the title feat(preview): present #Preview content as a SwiftUI preview fix(preview): add native visionOS Preview support Oct 18, 2026
@codecov

codecov Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.37%. Comparing base (4221d0b) to head (f346114).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
Sources/OpenSwiftUIMacros/PreviewMacro.swift 0.00% 17 Missing ⚠️
Sources/OpenSwiftUI/Integration/PreviewShims.swift 0.00% 5 Missing ⚠️
...penSwiftUI/Integration/LegacyPreviewProvider.swift 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1179   +/-   ##
=======================================
  Coverage   29.36%   29.37%           
=======================================
  Files         946      946           
  Lines       74842    74841    -1     
=======================================
+ Hits        21981    21984    +3     
+ Misses      52861    52857    -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tuist

tuist Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Tests 🧪

Scheme Status Ran test modules Commit
Unknown ⏳ 7 14cac1900
OpenSwiftUI ✅ 7 14cac1900

Builds 🔨

Scheme Status Duration Commit
OpenSwiftUI ✅ 1m 18s 14cac1900

@Kyle-Ye
Kyle-Ye merged commit 8df5e78 into main Oct 18, 2026
7 checks passed
@Kyle-Ye
Kyle-Ye deleted the feature/visionos_preview branch October 18, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: example Example apps, previews, sample projects, screenshots, or demo assets. platform: visionOS visionOS-specific behavior or support. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant