RealityKit sample architecture
Source-backed, high-level architecture notes for Apple sample-code pages grouped in the RealityKit folder.
- Catalog module labels:
RealityKit,realitykit - Coverage: 36 / 36 sample pages documented
- Source policy: archive hashes and extracted-tree references are verified locally before analysis
Samples
| Sample | Platforms | High-level architecture | Documented patterns |
|---|---|---|---|
| Altering RealityKit Rendering with Shader Functions | iOS, iPadOS | A C/Objective-C header, Metal, Swift sample with the source-visible chain PopApp → ContentView → Coordinator → RealityKit APIs. |
Coordinator |
| Animating entity rotation with a system | visionOS | A Swift sample with the source-visible chain RotationApp → ContentView → RotationSystem → RealityKit APIs. |
— |
| Bringing your SceneKit projects to RealityKit | iOS, iPadOS, Mac Catalyst, macOS, tvOS, visionOS | A Swift sample bundle with entry-bearing project variants Pyro Panda RealityKit, Pyro Panda SceneKit, each leading to RealityKit APIs. |
View-controller organization, Delegate or data-source callbacks, Binding-based state propagation |
| Building an immersive experience with RealityKit | iOS, iPadOS, Mac Catalyst | A C/Objective-C header, Metal, Swift sample with the source-visible chain AppDelegate → DebugSettingsViewController → GameManager → MetalRenderer → RealityKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| Building an object reconstruction app | macOS | A Swift sample with the source-visible chain ObjectCaptureReconstructionApp → ContentView → AppDataModel → RealityKit APIs. |
SwiftUI environment injection, Binding-based state propagation |
| Combining 2D and 3D views in an immersive app | visionOS | A Swift sample with the source-visible chain MultiDimensionalImmersiveContentApp → RainbowView → RainbowModel → RealityKit APIs. |
— |
| Composing interactive 3D content with RealityKit and Reality Composer Pro | visionOS | A Swift sample with the source-visible chain RealityKitAnimationApp → ContentView → AppModel → EntityMoverSystem → RealityKit / RealityKitContent APIs. |
— |
| Configuring Collision in RealityKit | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ViewController → RealityKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Construct an immersive environment for visionOS | visionOS | A Swift sample with the source-visible chain MeadowApp → ContentView → EnvironmentLoader → RealityKit / RealityKitContent APIs. |
Actor isolation |
| Controlling Entity Collisions in RealityKit | iOS, iPadOS | A Swift sample with the source-visible chain AppDelegate → ViewController → RealityKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Creating a game with scene understanding | iOS, iPadOS, Mac Catalyst | A C/Objective-C header, Metal, Swift sample with the source-visible chain AppDelegate → DebugSettingsViewController → GameManager → MetalRenderer → RealityKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| Creating a photogrammetry command-line app | macOS | A Swift sample centered on HelloPhotogrammetry, with direct use of ArgumentParser, Metal, RealityKit. |
— |
| Creating a Spaceship game | iOS, iPadOS, Mac Catalyst, visionOS | A C/Objective-C header, Objective-C++, Swift sample with the source-visible chain SpaceshipApp → MenuView → HangarViewModel → ClosureSystem → RealityKit APIs. |
Model-View-ViewModel |
| Creating a spatial drawing app with RealityKit | visionOS | A C/Objective-C header, Metal, Swift sample with the source-visible chain RealityKitDrawingApp → SplashScreenView → DrawingDocument → AnchorEntityInputProvider → RealityKit / RealityKitContent APIs. |
Protocol-oriented abstraction |
| Creating an App for Face-Painting in AR | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ContentView → RealityKit APIs. |
Delegate or data-source callbacks, Binding-based state propagation |
| Displaying low-latency connected video | visionOS | A Swift sample with the source-visible chain LowLatencyCameraStreamingApp → CameraView → CameraCoordinator → LowLatencyRenderer → RealityKit APIs. |
Delegate or data-source callbacks, Coordinator, Actor isolation |
| Docking a video player in an immersive scene | visionOS | A Swift sample with the source-visible chain DockingApp → AVPlayerView → AVPlayerViewModel → RealityKit APIs. |
Model-View-ViewModel, Delegate or data-source callbacks |
| Generating interactive geometry with RealityKit | macOS, visionOS | A C/Objective-C header, Metal, Swift sample with the source-visible chain GeneratingInteractiveGeometrySampleApp → HeightMapMeshView → Generator → RealityKit APIs. |
Protocol-oriented abstraction |
| Implementing special rendering effects with RealityKit postprocessing | iOS, iPadOS, Mac Catalyst | A C/Objective-C header, Metal, Swift sample with the source-visible chain AppDelegate → ContentView → Coordinator → RealityKit APIs. |
Delegate or data-source callbacks, Coordinator, Binding-based state propagation |
| Integrating virtual objects with your environment | visionOS | A Swift sample with the source-visible chain TinyTreasureTroveApp → ContentView → AppModel → GameObjectSystem → RealityKit APIs. |
— |
| Manipulating models with RealityKit | visionOS | A Swift sample with the source-visible chain ModelManipulatorApp → ClippingController → AppModel → ClippingTransformSyncSystem → RealityKit APIs. |
View-controller organization |
| Mixing spatial music | visionOS | A Swift sample with the source-visible chain MixingSpatialMusicApp → SettingsView → AppModel → ReverbMeshLoader → RealityKit APIs. |
Binding-based state propagation |
| Presenting an artist’s scene | visionOS | A Swift sample with the source-visible chain ArtistWorkflowExampleApp → ContentView → AppModel → RealityKit / RealityKitContent APIs. |
— |
| Presenting images in RealityKit | visionOS | A Swift sample with the source-visible chain SpatialPhotosSampleApp → ContentView → AppModel → RealityKit APIs. |
Delegate or data-source callbacks |
| Rendering a windowed game in stereo | visionOS | A C/Objective-C header, Metal, Swift sample with the source-visible chain RealityKitStereoRenderingApp → WindowView → HeadPositionProvider → RealityKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks, Binding-based state propagation, Actor isolation |
| Rendering stereoscopic video with RealityKit | visionOS | A Swift sample with the source-visible chain RealityKitPlaybackApp → ContentView → PlayerModel → SerialProcessor → AVFoundation / SwiftUI APIs. |
— |
| Responding to gestures on an entity | visionOS | A Swift sample with the source-visible chain GestureResponseApp → ContentView → RealityKit APIs. |
— |
| Scanning objects using Object Capture | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain GuidedCaptureSampleApp → ContentView → Coordinator → RealityKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks, Coordinator, Binding-based state propagation |
| Simulating particles in your visionOS app | visionOS | A Swift sample with the source-visible chain ParticleEmitterApp → MainView → GeneralGoalSystem → RealityKit APIs. |
SwiftUI environment injection, Binding-based state propagation |
| Simulating physics joints in your RealityKit app | iOS, iPadOS, Mac Catalyst, macOS, visionOS | A Swift sample with the source-visible chain RealityKitPhysicsJointApp → MainView → RealityKit APIs. |
— |
| Simulating physics with collisions in your visionOS app | visionOS | A Swift sample with the source-visible chain PhysicsBodiesApp → MainView → SphereAttractionSystem → RealityKit APIs. |
— |
| Tracking a handheld accessory as a virtual sculpting tool | visionOS | A C/Objective-C header, Metal, Swift sample with the source-visible chain SpatialSculptingApp → ContentView → HapticsModel → ComputeDispatchSystem → RealityKit APIs. |
Protocol-oriented abstraction |
| Transforming entities between RealityKit coordinate spaces | visionOS | A Swift sample with the source-visible chain CoordSpaceTransformApp → VolumetricView → AppModel → RealityKit APIs. |
— |
| Transforming RealityKit entities using gestures | visionOS | A Swift sample with the source-visible chain EntityGestureApp → ContentView → RealityKit / RealityKitContent APIs. |
— |
| Using object capture assets in RealityKit | iOS, iPadOS, Mac Catalyst | A Metal, Swift sample with the source-visible chain CaptureChessApp → ContentView → GameManager → MetalLibLoader → RealityKit APIs. |
Protocol-oriented abstraction, Delegate or data-source callbacks, Publisher-backed observable state |
| WWDC21 Challenge: Framework Freestyle | iOS, iPadOS | A Swift sample with the source-visible chain AppDelegate → ViewController → UIKit / ARKit APIs. |
View-controller organization, Delegate or data-source callbacks |
Cross-sample signals
Recurring documented patterns
| Pattern label | Sample documents |
|---|---|
| Delegate or data-source callbacks | 14 |
| View-controller organization | 9 |
| Binding-based state propagation | 8 |
| Protocol-oriented abstraction | 8 |
| Coordinator | 4 |
| Actor isolation | 3 |
| SwiftUI environment injection | 2 |
| Model-View-ViewModel | 2 |
Type-role naming evidence
Counts below are declaration-name suffixes, not inferred patterns.
| Role suffix | Distinct declarations across samples |
|---|---|
View |
142 |
Component |
89 |
System |
42 |
App |
28 |
Delegate |
24 |
Model |
20 |
Controller |
14 |
Generator |
7 |
Renderer |
6 |
Coordinator |
4 |
Manager |
4 |
Player |
4 |
Provider |
4 |
Handler |
3 |
Loader |
3 |
ViewModel |
3 |
Document |
2 |
Scene |
2 |
Session |
1 |
Processor |
1 |
Swift access-control evidence
These are declaration occurrences in scanned Swift source, including implicit internal declarations.
| Access level | Occurrences |
|---|---|
implicit internal |
8388 |
private |
1235 |
public |
726 |
fileprivate |
67 |
private(set) |
67 |
internal |
51 |
open |
3 |
References
Generated from the verified local catalog and completed Markdown documents.