Back to Browse

SwiftUI visionOS β€” padding3D and Multiple Windows From Scratch

104 views
Apr 18, 2026
34:17

Two core visionOS concepts. One cohesive app. Built from scratch. We're building a solar system app that uses .padding3D to push orbital rings into genuine 3D space, and openWindow(value:) to launch individual planet detail panels as independent floating windows. Drag the depth slider and orbit the camera. Watch flat concentric circles become a spatial tunnel. Tap a planet - it appears in your room as its own frameless window. That's visionOS. ⭐ GitHub Repo: https://github.com/NDCSwift/visionos-solar-system πŸ“Œ This is Video 2 of the visionOS series: β†’ Video 1: Getting Started β†’ https://youtu.be/ggm_B1CCz8k β†’ Video 2: Depth & Multiple Windows (this video) β†’ Video 3: Volumes & ImmersiveSpace β†’ coming soon Based on Apple's official visionOS beginner tutorials: β†’ Add depth to your app β†’ Present common controls in an ornament ⏱️ Timestamps: 00:00 β€” What we're building + the two concepts 01:05 β€” New project setup 01:40 β€” Planet model β€” Hashable + Codable explained 05:56 β€” OrbitalRingsView β€” ZStack + ForEach + padding3D 12:02 β€” The depth reveal 12:55 β€” ContentView + ornament with Grid controls 20:08 β€” Planet dots on the rings 23:20 β€” Testing Rings and Planets in Simulator 24:16 β€” openWindow(id:) vs openWindow(value:) β€” which to use 24:55 β€” WindowGroup(for: Planet.self) in the App struct 26:34 β€” .windowStyle(.plain) + defaultWindowPlacement 27:50 β€” PlanetDetailView + dismissWindow 31:36 β€” Full demo 33:38 β€” What's next: Volumes + ImmersiveSpace πŸ“Œ Key APIs: β€” .padding3D(.back, depth) β€” real Z-axis depth in a flat window β€” Grid + GridRow β€” aligned multi-row controls β€” ColorPicker β€” live color updates β€” .windowResizability(.contentSize) β€” .ornament(attachmentAnchor: .scene(.bottom)) β€” .glassBackgroundEffect() β€” Planet: Hashable, Codable β€” required by openWindow(value:) β€” openWindow(id:) β€” singleton window, no payload β€” openWindow(value: planet) β€” typed window, one per unique Hashable value β€” WindowGroup(for: Planet.self) { $planet in } defaultValue: { } β€” .windowStyle(.plain) β€” frameless floating window β€” @Environment(\.dismissWindow) #visionOS #SwiftUI #iOSDevelopment #VisionPro #SpatialComputing

Download

0 formats

No download links available.

SwiftUI visionOS β€” padding3D and Multiple Windows From Scratch | NatokHD