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 | A Swift sample with the source-visible chain AccessingTheMainCameraApp → ContentView → CameraSessionManager → SwiftUI / ARKit APIs. |
— |
| Adding a depth effect to text in visionOS | visionOS | A Swift sample with the source-visible chain EntryPoint → MainView → SwiftUI APIs. |
— |
| Animating hand models in visionOS | visionOS | A Swift sample with the source-visible chain AnimatingHandModelsApp → ContentView → AppModel → SwiftUI / ARKit APIs. |
— |
| Applying mesh to real-world surroundings | visionOS | A Swift sample with the source-visible chain EntryPoint → MainView → MeshAnchorGenerator → SwiftUI / ARKit APIs. |
— |
| Associating a window with an immersive space | visionOS | A Swift sample with the source-visible chain SampleApp → ContentView → AppModel → SwiftUI / RealityKit APIs. |
— |
| BOT-anist | iOS, iPadOS, Mac Catalyst, macOS, visionOS | A Swift sample with the source-visible chain BOTanistApp → ContentView → PlantAnimationProvider → RealityKit / SwiftUI APIs. |
— |
| Building an immersive media viewing experience | visionOS | A Swift sample with the source-visible chain DestinationVideo → ContentView → Coordinator → EnvironmentStateHandler → SwiftUI / SwiftData APIs. |
Delegate or data-source callbacks, Coordinator |
| Building local experiences with room tracking | visionOS | A Swift sample with the source-visible chain ARKitRoomTrackingApp → ContentView → RealityKit / SwiftUI APIs. |
— |
| Canyon Crosser: Building a volumetric hike-planning app | visionOS | A Swift sample with the source-visible chain CanyonCrosserApp → ContentView → AppModel → ClippingMarginPercentageSystem → SwiftUI / RealityKit APIs. |
Protocol-oriented abstraction, Binding-based state propagation |
| Chaparral Village: Building an immersive visionOS adventure game | visionOS | A Shell, Swift sample with the source-visible chain ChaparralVillageApp → ContentView → ARManager → ContainerHandler → RealityKit / Spatial APIs. |
View-controller organization, Protocol-oriented abstraction, Binding-based state propagation |
| Connecting iPadOS and visionOS apps over the local network | iOS, iPadOS, Mac Catalyst, visionOS | A Swift sample with the source-visible chain CompanionApp → ServerContentView → RobotViewModel → Client → SwiftUI / PeerToPeerMessaging APIs. |
Model-View-ViewModel, Protocol-oriented abstraction, Actor isolation |
| Creating 2D shapes with SwiftUI | visionOS | A Swift sample with the source-visible chain EntryPoint → MainView → SwiftUI APIs. |
— |
| Creating 3D entities with RealityKit | visionOS | A Swift sample with the source-visible chain EntryPoint → ShapesView → RealityKit / SwiftUI APIs. |
— |
| Creating 3D models as movable windows | visionOS | A Swift sample whose EntryPoint entry flows through VolumetricWindow before reaching SwiftUI / RealityKit APIs. |
— |
| Creating a 3D painting space | visionOS | A Swift sample with the source-visible chain EntryPoint → MainView → ClosureSystem → RealityKit / SwiftUI APIs. |
Publisher-backed observable state |
| Creating an immersive space in visionOS | visionOS | A Swift sample with the source-visible chain EntryPoint → MainView → TurnTableSystem → SwiftUI / RealityKit APIs. |
— |
| Creating an interactive 3D model in visionOS | visionOS | A Swift sample with the source-visible chain EntryPoint → MainView → SwiftUI / RealityKit APIs. |
— |
| Creating SwiftUI windows in visionOS | visionOS | A Swift sample with the source-visible chain EntryPoint → MainView → SwiftUI APIs. |
— |
| Designing no-code games with Reality Composer Pro 3 | visionOS | A Shell, Swift sample with the source-visible chain SquirrelApp → ContentView → SwiftUI / RealityKit APIs. |
Binding-based state propagation |
| Destination Video | iOS, iPadOS, Mac Catalyst, macOS, tvOS, visionOS | A Swift sample with the source-visible chain DestinationVideo → ContentView → Coordinator → EnvironmentStateHandler → SwiftUI / SwiftData APIs. |
Delegate or data-source callbacks, Coordinator |
| Diorama | visionOS | A Swift sample with the source-visible chain DioramaApp → ContentView → ViewModel → AttachmentsProvider → RealityKit / SwiftUI APIs. |
Model-View-ViewModel, Delegate or data-source callbacks |
| Displaying a 3D environment through a portal | visionOS | A Swift sample with the source-visible chain EntryPoint → UIPortalView → AppModel → SwiftUI / RealityKit APIs. |
— |
| Displaying a stereoscopic image | visionOS | A Swift sample with the source-visible chain EntryPoint → MainView → SwiftUI / RealityKit APIs. |
— |
| Displaying an entity that follows a person’s view | visionOS | A Swift sample with the source-visible chain EntryPoint → MainView → HeadPositionTracker → SwiftUI / RealityKit APIs. |
— |
| Displaying text in visionOS | visionOS | A Swift sample with the source-visible chain TextApp → MainView → SwiftUI APIs. |
— |
| Displaying video from connected devices | visionOS | A Swift sample with the source-visible chain DisplayConnectedVideoApp → ContentView → CaptureManager → AVFoundation / SwiftUI APIs. |
Delegate or data-source callbacks, Actor isolation |
| Drawing in the air and on surfaces with a spatial stylus | visionOS | A C/Objective-C header, Swift sample with the source-visible chain SurfaceInkingApp → StylusDrawingSettingsView → AppModel → BrushStyleProvider → RealityKit / SwiftUI APIs. |
Protocol-oriented abstraction |
| Embedding controls in an immersive space | visionOS | A Swift sample with the source-visible chain SampleApp → ContentView → AppModel → SwiftUI / RealityKit APIs. |
— |
| Enabling video reflections in an immersive environment | visionOS | A Swift sample with the source-visible chain DestinationVideo → ContentView → Coordinator → EnvironmentStateHandler → SwiftUI / SwiftData APIs. |
Delegate or data-source callbacks, Coordinator |
| Exploring object tracking with ARKit | visionOS | A Swift sample with the source-visible chain ObjectTrackingApp → HomeView → ReferenceObjectLoader → ARKit / SwiftUI APIs. |
— |
| Gaussian splats on visionOS | visionOS | A Swift sample with the source-visible chain GaussianSplatsOnVisionOSApp → ContentView → SplatViewCoordinator → RealityKit / SwiftUI APIs. |
Coordinator |
| Generating procedural textures | visionOS | A Metal, Swift sample with the source-visible chain Drawable → DrawableView → ProceduralTextureGenerator → SwiftUI / RealityKit APIs. |
— |
| Handling the window life cycle with multiple scenes | visionOS | A Swift sample with the source-visible chain SampleApp → ContentView → AppModel → SwiftUI / PackageDescription APIs. |
— |
| Happy Beam | visionOS | A Swift sample with the source-visible chain HappyBeamApp → GameModel → Player → SwiftUI / RealityKit APIs. |
Publisher-backed observable state |
| Hello World | visionOS | A Swift sample with the source-visible chain WorldApp → ItemView → ViewModel → RotationSystem → SwiftUI / RealityKit APIs. |
Model-View-ViewModel, Binding-based state propagation |
| Implementing adjustable material | visionOS | A Swift sample with the source-visible chain EntryPoint → MainView → SwiftUI / RealityKit APIs. |
— |
| Implementing SharePlay for immersive spaces in visionOS | visionOS | A Swift sample with the source-visible chain SharePlayCubeApp → CubeImmersiveView → AppModel → GroupActivities / SwiftUI APIs. |
View-controller organization |
| Incorporating real-world surroundings in an immersive experience | visionOS | A Swift sample with the source-visible chain SceneReconstructionExampleApp → EntityModel → ARKit / RealityKit APIs. |
— |
| Locating and decoding barcodes in 3D space | visionOS | A Swift sample with the source-visible chain LocatingAndDecodingBarcodesApp → ContentView → AppModel → SwiftUI / RealityKit APIs. |
— |
| Manipulating entities with solid collisions | visionOS | A Swift sample with the source-visible chain ManipulateWithSolidCollisionsApp → ContentView → AppModel → ManipulateWithSolidCollisionsSystem → RealityKit / SwiftUI APIs. |
— |
| Monitoring fit and field of view fidelity | visionOS | A Swift sample with the source-visible chain VisualFidelityApp → ContentView → AppModel → SwiftUI / ARKit APIs. |
— |
| Object tracking with Reality Composer Pro experiences | visionOS | A Swift sample with the source-visible chain ObjectTrackingExperiencesSampleApp → ContentView → AppModel → FadeOutSystem → SwiftUI / RealityKit APIs. |
— |
| Obscuring virtual items in a scene behind real-world items | visionOS | A Swift sample with the source-visible chain EntryPoint → MainView → MeshAnchorGenerator → SwiftUI / ARKit APIs. |
— |
| Petite Asteroids: Building a volumetric visionOS game | visionOS | A C/Objective-C header, Metal, Swift sample with the source-visible chain PetiteAsteroids → ContentView → AppModel → AudioCueSystem → RealityKit / RealityKitContent APIs. |
— |
| Placing content on detected planes | visionOS | A Swift sample with the source-visible chain ObjectPlacementApp → HomeView → PersistenceManager → ModelLoader → RealityKit / SwiftUI APIs. |
— |
| Placing entities using head and device transform | visionOS | A Swift sample with the source-visible chain HeadTrackingApp → ImmersiveView → AppModel → FollowSystem → SwiftUI / ARKit APIs. |
— |
| Playing immersive media with RealityKit | visionOS | A Swift sample with the source-visible chain RealityKitImmersivePlaybackApp → ContentView → AppModel → SwiftUI / RealityKit APIs. |
— |
| Playing spatial audio | visionOS | A Swift sample with the source-visible chain EntryPoint → SpatialAudioView → SwiftUI / RealityKit APIs. |
— |
| Swift Splash | visionOS | A Swift sample with the source-visible chain SwiftSplashApp → ContentView → SoundEffectPlayer → RealityKit / SwiftSplashTrackPieces APIs. |
Actor isolation |
| Tracking and visualizing hand movement | visionOS | A Swift sample with the source-visible chain HandTracking → MainView → HandTrackingSystem → ARKit / RealityKit APIs. |
— |
| Tracking specific points in world space | visionOS | A Swift sample with the source-visible chain ObjectPlacementApp → HomeView → PersistenceManager → ModelLoader → RealityKit / SwiftUI APIs. |
— |
| Working with generic spatial accessories | visionOS | A Swift sample with the source-visible chain WorkingWithGenericSpatialAccessoriesApp → ContentView → AccessoryModel → SwiftUI / RealityKit APIs. |
— |
Cross-sample signals
Recurring documented patterns
| Pattern label | Sample documents |
|---|---|
| Delegate or data-source callbacks | 5 |
| Coordinator | 4 |
| Protocol-oriented abstraction | 4 |
| Binding-based state propagation | 4 |
| Model-View-ViewModel | 3 |
| Actor isolation | 3 |
| View-controller organization | 2 |
| Publisher-backed observable state | 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.