Collection

visionOS sample architecture

Source-backed, high-level architecture notes for Apple sample-code pages grouped in the visionOS folder.

  • Catalog module label: visionOS
  • Coverage: 52 / 52 sample pages documented
  • Source policy: archive hashes and extracted-tree references are verified locally before analysis

Samples

Sample Platforms High-level architecture Documented patterns
Accessing the main camera visionOS AccessingTheMainCameraApp presents MainCameraView; a main-actor camera manager owns ARKit camera authorization/providers and publishes AVFoundation display layers. SwiftUI scene composition, Observable state owner, Provider session boundary, Async update consumer, Platform-view adapter
Adding a depth effect to text in visionOS visionOS A code-light SwiftUI sample: EntryPoint declares WindowGroup, MainView owns the visible behavior, and there is no separate service or persistence layer. SwiftUI scene composition
Animating hand models in visionOS visionOS AnimatingHandModelsApp composes WindowGroup + ImmersiveSpace around ContentView; AppModel coordinates ARKit provider updates and maps anchors into RealityKit content. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Provider session boundary, Async update consumer
Applying mesh to real-world surroundings visionOS EntryPoint composes WindowGroup + ImmersiveSpace around MainView; MeshAnchorGenerator coordinates ARKit provider updates and maps anchors into RealityKit content. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Provider session boundary, Async update consumer
Associating a window with an immersive space visionOS SampleApp composes Window + ImmersiveSpace around ContentView; AppModel owns interaction while RealityView manages the entity graph. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner
BOT-anist iOS, iPadOS, Mac Catalyst, macOS, visionOS BOTanistApp composes WindowGroup + volumetric window around ContentView; AppState holds shared experience state and RealityKit components and systems own per-entity behavior. SwiftUI scene composition, SwiftUI–RealityKit bridge, Observable state owner, Entity-component-system, Async update consumer
Building an immersive media viewing experience visionOS DestinationVideo owns the stable PlayerModel; catalog UI changes presentation state and the immersive view maps that model into RealityKit playback. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Async update consumer, Player model
Building local experiences with room tracking visionOS ARKitRoomTrackingApp composes WindowGroup + ImmersiveSpace around ContentView; AppState coordinates ARKit provider updates and maps anchors into RealityKit content. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Provider session boundary, Async update consumer
Canyon Crosser: Building a volumetric hike-planning app visionOS CanyonCrosserApp composes WindowGroup + volumetric window around ContentView; AppModel holds shared experience state and RealityKit components and systems own per-entity behavior. SwiftUI scene composition, SwiftUI–RealityKit bridge, Observable state owner, Entity-component-system, Protocol capability boundary
Chaparral Village: Building an immersive visionOS adventure game visionOS ChaparralVillageApp composes WindowGroup + volumetric window + ImmersiveSpace around ContentView; AppState holds shared experience state and RealityKit components and systems own per-entity behavior. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Entity-component-system, Provider session boundary
Connecting iPadOS and visionOS apps over the local network iOS, iPadOS, Mac Catalyst, visionOS Separate iPadOS and visionOS app targets share a protocol-based peer-messaging package; actor-backed client/server transports own discovery and connections while RobotViewModel maps messages into UI state. SwiftUI scene composition, SwiftUI–RealityKit bridge, Observable state owner, Async update consumer, Protocol-based peer transport, Protocol capability boundary
Creating 2D shapes with SwiftUI visionOS A code-light SwiftUI sample: EntryPoint declares WindowGroup, MainView owns the visible behavior, and there is no separate service or persistence layer. SwiftUI scene composition
Creating 3D entities with RealityKit visionOS EntryPoint composes WindowGroup around ShapesView; view-local SwiftUI state owns interaction while RealityView manages the entity graph. SwiftUI scene composition, SwiftUI–RealityKit bridge
Creating 3D models as movable windows visionOS EntryPoint composes WindowGroup + volumetric window around VolumetricWindow; view-local SwiftUI state owns interaction while RealityView manages the entity graph. SwiftUI scene composition, SwiftUI–RealityKit bridge
Creating a 3D painting space visionOS EntryPoint composes WindowGroup + ImmersiveSpace around MainView; PaintingHandTracking coordinates ARKit provider updates and maps anchors into RealityKit content. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Entity-component-system, Provider session boundary
Creating an immersive space in visionOS visionOS EntryPoint composes WindowGroup + ImmersiveSpace around MainView; component values store per-entity state and registered RealityKit systems own repeated behavior. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Entity-component-system
Creating an interactive 3D model in visionOS visionOS EntryPoint composes WindowGroup + ImmersiveSpace around MainView; view-local SwiftUI state owns interaction while RealityView manages the entity graph. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle
Creating SwiftUI windows in visionOS visionOS A code-light SwiftUI sample: EntryPoint declares WindowGroup, MainView owns the visible behavior, and there is no separate service or persistence layer. SwiftUI scene composition
Designing no-code games with Reality Composer Pro 3 visionOS SquirrelApp is a thin SwiftUI shell around authored Reality Composer Pro content; ContentView supplies attachments and sends events while Script Graph owns most game behavior. SwiftUI scene composition, SwiftUI–RealityKit bridge, Script Graph event bridge
Destination Video iOS, iPadOS, Mac Catalyst, macOS, tvOS, visionOS DestinationVideo creates the SwiftData catalog and PlayerModel; player and watching coordinators split AVPlayer lifetime, presentation state, and SharePlay synchronization. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Async update consumer, Playback coordinator adapter
Diorama visionOS DioramaApp composes WindowGroup + ImmersiveSpace around ContentView; ViewModel holds shared experience state and RealityKit components and systems own per-entity behavior. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Entity-component-system, Provider session boundary
Displaying a 3D environment through a portal visionOS EntryPoint composes WindowGroup + ImmersiveSpace around UIPortalView; AppModel owns interaction while RealityView manages the entity graph. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner
Displaying a stereoscopic image visionOS EntryPoint composes WindowGroup around MainView; view-local SwiftUI state owns interaction while RealityView manages the entity graph. SwiftUI scene composition, SwiftUI–RealityKit bridge
Displaying an entity that follows a person’s view visionOS EntryPoint composes WindowGroup + ImmersiveSpace around MainView; HeadPositionTracker coordinates ARKit provider updates and maps anchors into RealityKit content. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Entity-component-system, Provider session boundary
Displaying text in visionOS visionOS A code-light SwiftUI sample: TextApp declares WindowGroup, MainView owns the visible behavior, and there is no separate service or persistence layer. SwiftUI scene composition
Displaying video from connected devices visionOS DisplayConnectedVideoApp presents ContentView; DeviceManager separates device discovery/connection from AVCaptureSession ownership and preview adaptation. SwiftUI scene composition, Observable state owner, Async update consumer, Platform-view adapter, Capture-to-preview adapter
Drawing in the air and on surfaces with a spatial stylus visionOS SurfaceInkingApp composes WindowGroup + ImmersiveSpace around StylusDrawingSettingsView; AppModel coordinates ARKit provider updates and maps anchors into RealityKit content. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Provider session boundary, Async update consumer
Embedding controls in an immersive space visionOS SampleApp composes Window + WindowGroup + ImmersiveSpace around ContentView; AppModel owns interaction while RealityView manages the entity graph. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner
Enabling video reflections in an immersive environment visionOS PlayerModel owns playback while ImmersiveEnvironment and its state handler map the selected environment into RealityKit environment-probe blending. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Async update consumer, Environment-probe state adapter
Exploring object tracking with ARKit visionOS ObjectTrackingApp composes WindowGroup + ImmersiveSpace around HomeView; AppState coordinates ARKit provider updates and maps anchors into RealityKit content. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Provider session boundary, Async update consumer
Gaussian splats on visionOS visionOS GaussianSplatsOnVisionOSApp composes WindowGroup + ImmersiveSpace around ContentView; AppModel coordinates scene-reconstruction updates while a dedicated coordinator/renderer owns Gaussian-splat resources. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Provider session boundary, Low-level render-buffer builder
Generating procedural textures visionOS Drawable composes WindowGroup around DrawableView; component values store per-entity state and registered RealityKit systems own repeated behavior. SwiftUI scene composition, SwiftUI–RealityKit bridge, Entity-component-system
Handling the window life cycle with multiple scenes visionOS SampleApp composes Window + WindowGroup + volumetric window around ContentView; AppModel owns interaction while RealityView manages the entity graph. SwiftUI scene composition, SwiftUI–RealityKit bridge, Observable state owner
Happy Beam visionOS HappyBeamApp composes WindowGroup + ImmersiveSpace; GameModel owns GroupActivities session state and HappyBeam reflects synchronized transitions. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Provider session boundary, Reliable/unreliable SharePlay channels
Hello World visionOS WorldApp composes Window + WindowGroup + volumetric window + ImmersiveSpace around Modules; ViewModel holds shared experience state and RealityKit components and systems own per-entity behavior. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Entity-component-system
Implementing adjustable material visionOS GlassApp composes WindowGroup around MainView; view-local SwiftUI state owns interaction while RealityView manages the entity graph. SwiftUI scene composition, SwiftUI–RealityKit bridge
Implementing SharePlay for immersive spaces in visionOS visionOS SharePlayCubeApp composes ImmersiveSpace; AppModel owns GroupActivities session state and CubeImmersiveView reflects synchronized transitions. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Async update consumer, Shared-session model
Incorporating real-world surroundings in an immersive experience visionOS SceneReconstructionExampleApp composes ImmersiveSpace around CubeMeshInteraction; EntityModel coordinates ARKit provider updates and maps anchors into RealityKit content. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Provider session boundary, Async update consumer
Locating and decoding barcodes in 3D space visionOS LocatingAndDecodingBarcodesApp composes WindowGroup + ImmersiveSpace around ContentView; AppModel coordinates ARKit provider updates and maps anchors into RealityKit content. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Provider session boundary, Async update consumer
Manipulating entities with solid collisions visionOS ManipulateWithSolidCollisionsApp composes WindowGroup + volumetric window around ContentView; AppModel holds shared experience state and RealityKit components and systems own per-entity behavior. SwiftUI scene composition, SwiftUI–RealityKit bridge, Observable state owner, Entity-component-system
Monitoring fit and field of view fidelity visionOS VisualFidelityApp composes WindowGroup + ImmersiveSpace around ContentView; AppModel coordinates ARKit provider updates and maps anchors into RealityKit content. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Provider session boundary, Async update consumer
Object tracking with Reality Composer Pro experiences visionOS ObjectTrackingExperiencesSampleApp composes WindowGroup + ImmersiveSpace around ContentView; AppModel coordinates ARKit provider updates and maps anchors into RealityKit content. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Entity-component-system, Provider session boundary
Obscuring virtual items in a scene behind real-world items visionOS EntryPoint composes WindowGroup + ImmersiveSpace around MainView; MeshAnchorGenerator coordinates ARKit provider updates and maps anchors into RealityKit content. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Provider session boundary, Async update consumer
Petite Asteroids: Building a volumetric visionOS game visionOS PetiteAsteroids composes WindowGroup + volumetric window around ContentView; AppModel holds shared experience state and RealityKit components and systems own per-entity behavior. SwiftUI scene composition, SwiftUI–RealityKit bridge, Observable state owner, Entity-component-system
Placing content on detected planes visionOS ObjectPlacementApp composes WindowGroup + ImmersiveSpace around HomeView; AppState coordinates ARKit provider updates and maps anchors into RealityKit content. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Provider session boundary, Plane projection pipeline
Placing entities using head and device transform visionOS HeadTrackingApp composes WindowGroup + ImmersiveSpace around ImmersiveView; AppModel coordinates ARKit provider updates and maps anchors into RealityKit content. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Entity-component-system, Provider session boundary
Playing immersive media with RealityKit visionOS RealityKitImmersivePlaybackApp composes WindowGroup + ImmersiveSpace; AppModel keeps player and presentation state stable while ProgressivePlayerImmersiveSpace maps it into RealityKit immersive playback. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Async update consumer
Playing spatial audio visionOS EntryPoint composes WindowGroup around SpatialAudioView; the view owns RealityKit audio entities and playback controllers as local scene state. SwiftUI scene composition, SwiftUI–RealityKit bridge, Entity-scoped audio component
Swift Splash visionOS SwiftSplash composes WindowGroup + ImmersiveSpace around ContentView; AppState holds shared experience state and RealityKit components and systems own per-entity behavior. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Entity-component-system, Provider session boundary
Tracking and visualizing hand movement visionOS HandTracking composes WindowGroup + ImmersiveSpace around MainView; HandTrackingSystem coordinates ARKit provider updates and maps anchors into RealityKit content. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Entity-component-system, Provider session boundary, Async update consumer
Tracking specific points in world space visionOS ObjectPlacementApp composes WindowGroup + ImmersiveSpace around HomeView; AppState coordinates ARKit provider updates and maps anchors into RealityKit content. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Provider session boundary, Persistent world-anchor mapping
Working with generic spatial accessories visionOS WorkingWithGenericSpatialAccessoriesApp composes Window + WindowGroup + volumetric window + ImmersiveSpace around ContentView; AppModel coordinates ARKit provider updates and maps anchors into RealityKit content. SwiftUI scene composition, SwiftUI–RealityKit bridge, Explicit immersive-space lifecycle, Observable state owner, Provider session boundary, Async update consumer

Cross-sample signals

Recurring documented patterns

Pattern label Sample documents
SwiftUI scene composition 52
SwiftUI–RealityKit bridge 46
Observable state owner 36
Explicit immersive-space lifecycle 33
Provider session boundary 23
Async update consumer 20
Entity-component-system 15
Platform-view adapter 2
Protocol capability boundary 2

Type-role naming evidence

Counts below are declaration-name suffixes, not inferred patterns.

Role suffix Distinct declarations across samples
View 240
System 102
Component 91
Model 34
App 32
Manager 20
Handler 17
Coordinator 7
Generator 5
Provider 4
Delegate 4
Tracker 4
Observer 3
Player 3
ViewModel 3
Loader 3
Controller 2
Client 1
Command 1
Document 1

Swift access-control evidence

These are declaration occurrences in scanned Swift source, including implicit internal declarations.

Access level Occurrences
implicit internal 8820
private 1594
public 1516
private(set) 81
fileprivate 55
internal 12

References

Generated from the verified local catalog and completed Markdown documents.