ARKit sample architecture
Source-backed, high-level architecture notes for Apple sample-code pages grouped in the ARKit folder.
- Catalog module label:
ARKit - Coverage: 25 / 25 sample pages documented
- Source policy: archive hashes and extracted-tree references are verified locally before analysis
Samples
| Sample | Platforms | High-level architecture | Documented patterns |
|---|---|---|---|
| Adding realistic reflections to an AR experience | iOS, iPadOS | A UIKit storyboard app. AppDelegate checks ARKit support and supplies a scene configuration; an empty SceneDelegate lets the scene manifest load Main.storyboard. One ViewController owns the ARSCNView, runs and pauses the session, receives SceneKit and ARKit delegate callbacks, handles gestures, and manages a nested ManualProbe value. |
View-controller organization, Delegate or data-source callbacks |
| Building local experiences with room tracking | visionOS | A Swift sample with the source-visible chain ARKitRoomTrackingApp → ContentView → ARKit APIs. |
— |
| Capturing Body Motion in 3D | iOS, iPadOS | UIKit scene-based shell (AppDelegate + SceneDelegate + Main.storyboard) hosting one ViewController that owns the ARView, runs the session, and receives ARSessionDelegate callbacks. |
Delegate or data-source callbacks |
| Combining user face-tracking and world tracking | iOS, iPadOS | A storyboard UIKit app with scene-based lifecycle. One ViewController runs a RealityKit ARView with a world-tracking configuration that also tracks the user’s face. A RobotHead entity attached to a camera anchor mirrors the face’s blend shapes. A tap re-anchors the head in the world and freezes it. |
Delegate or data-source callbacks |
| Creating a collaborative session | iOS, iPadOS | A UIKit storyboard app. ViewController owns the ARView session configuration and creates a MultipeerSession, passing it four handler closures. MultipeerSession owns the MCSession, advertiser, and browser and reports peer events back through those closures. |
View-controller organization, Delegate or data-source callbacks, Closure-based handler injection |
| Creating a fog effect using scene depth | iOS, iPadOS | Storyboard UIKit app. ViewController creates the ARSession and a Renderer, and forwards MTKViewDelegate callbacks to it. Renderer reads session.currentFrame on every draw and encodes a blur pass and a fog pass. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| Creating a multiuser AR experience | iOS, iPadOS | Storyboard UIKit app with one ViewController. It runs the ARSCNView session, owns a MultipeerSession wrapper, and encodes and decodes the two message types. |
View-controller organization, Delegate or data-source callbacks |
| Creating an immersive ar experience with audio | iOS, iPadOS | One storyboard-driven UIKit app target with a single ViewController that is also the ARSCNViewDelegate. It shows a translucent PreviewNode at the screen center until ARKit detects a horizontal plane, then moves the model onto the plane’s node and attaches a looping positional SCNAudioPlayer. |
View-controller organization, Delegate or data-source callbacks |
| Creating screen annotations for objects in an AR experience | iOS, iPadOS | One storyboard-driven UIKit app target. A single ViewController holds a RealityKit ARView, the list of StickyNoteEntity anchors, and the overlay views. Each entity carries a ScreenSpaceComponent that owns a UIKit StickyNoteView; every scene update projects the entity’s 3D position to a 2D screen point and moves the view there. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| Detecting Images in an AR Experience | iOS, iPadOS | A storyboard UIKit app with scene-based lifecycle. One ViewController owns the ARSCNView session setup and receives SceneKit-renderer and AR-session callbacks. It embeds a child StatusViewController that shows timed messages and a restart button. |
View-controller organization, Delegate or data-source callbacks |
| Displaying a point cloud using scene depth | iOS, iPadOS | A SwiftUI app whose views are MTKViews wrapped in UIViewRepresentable. A shared ARReceiver owns the ARSession and forwards frames to a weak ARDataReceiver delegate. ARProvider (that delegate) converts pixel buffers to Metal textures and runs the GPU upscaling pass. Each MTKView has a UIViewRepresentable coordinator subclass that draws one texture or the point cloud. |
Delegate or data-source callbacks, Binding-based state propagation, Singleton |
| Effecting People Occlusion in Custom Renderers | iOS, iPadOS | A storyboard UIKit app. ViewController creates the ARSession and a Renderer, then forwards MTKView callbacks to it. Renderer draws the camera image and anchor cubes offscreen, then composites them with the matte in a final pass. |
Delegate or data-source callbacks, Protocol-oriented abstraction |
| Occluding virtual content with people | iOS, iPadOS | A single-scene UIKit app. AppDelegate returns the scene configuration, SceneDelegate adopts the storyboard window, and one storyboard-instantiated ViewController owns the ARView outlet, loads the model, and reconfigures the running session on each tap. |
Delegate or data-source callbacks |
| Placing objects and handling 3D interaction | iOS, iPadOS | One storyboard-driven UIKit app target. The root ViewController owns the AR session configuration, a VirtualObjectLoader, a VirtualObjectInteraction gesture handler, a FocusSquare node, and a serial updateQueue. An embedded StatusViewController shows messages, and a popover VirtualObjectSelectionViewController reports choices through a delegate protocol. |
View-controller organization, Delegate or data-source callbacks |
| Recognizing and Labeling Arbitrary Objects | iOS, iPadOS | A UIKit storyboard app. AppDelegate checks ARKit support and supplies the scene configuration; an empty SceneDelegate lets the scene manifest load Main.storyboard. The main ViewController owns the ARSKView, the Vision request, and the label map. A child StatusViewController, embedded by a storyboard container segue, shows messages and reports restart taps through a closure. |
View-controller organization, Delegate or data-source callbacks |
| Saving and loading world data | iOS, iPadOS | A single-scene UIKit app. AppDelegate returns the scene configuration and SceneDelegate adopts the storyboard window. One ViewController is the ARSCNView and ARSession delegate and owns the whole feature: placement, mapping-status UI, save, load, and reset. |
Delegate or data-source callbacks |
| Scanning and Detecting 3D Objects | iOS, iPadOS | A UIKit storyboard app. One ViewController, split across extensions by concern, owns the ARSCNView and an app-level State machine. In the scanning state it creates a Scan (its own State machine plus the SceneKit nodes ScannedObject and ScannedPointCloud); in testing it creates a TestRun (owns a DetectedObject). SceneKit nodes and models talk back through NotificationCenter, and several types reach the controller through a global ViewController.instance. |
View-controller organization, Delegate or data-source callbacks, Observer, Protocol-oriented abstraction |
| Streaming an AR experience | iOS, iPadOS | UIKit storyboard app. SceneDelegate adds a transparent overlay window. ViewController runs the ARView, owns the codec and networking helpers, and wires them together. OverlayViewController owns a Metal Renderer that draws the remote peer’s video. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| 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 → ARKit APIs. |
Protocol-oriented abstraction |
| Tracking accessories in volumetric windows | visionOS | A Swift sample with the source-visible chain TrackingAccessoriesApp → AccessoryTrackingView → AccessoryTrackingModel → ThrowSpeedTracker → ARKit APIs. |
View-controller organization |
| Tracking and altering images | iOS, iPadOS | A Swift sample with the source-visible chain AppDelegate → ViewController → ARKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| Tracking and visualizing faces | iOS, iPadOS | A single-scene UIKit app. ViewController owns the ARSCNView, runs the session, and keeps one VirtualContentController per ARFaceAnchor. A tab bar selects a VirtualContentType, whose makeController() builds the matching controller. The view controller forwards SceneKit renderer callbacks to that controller. |
Delegate or data-source callbacks, Protocol-oriented abstraction, Factory |
| Tracking and visualizing planes | iOS, iPadOS | UIKit scene-based shell (AppDelegate + SceneDelegate + Main.storyboard) hosting one ViewController; a Plane SCNNode subclass encapsulates per-anchor visualization. |
Delegate or data-source callbacks |
| Tracking geographic locations in AR | iOS, iPadOS | A storyboard UIKit app with one ViewController that owns the ARView session setup, a CLLocationManager, and the map. Separate extensions add coaching, GPX load/save, and helpers. GPXParser and GPXExporter handle the file format. |
Delegate or data-source callbacks |
| Visualizing and interacting with a reconstructed scene | iOS, iPadOS | A storyboard UIKit app with scene-based lifecycle. A single ViewController configures a RealityKit ARView for mesh reconstruction with classification, occlusion, and physics. It handles taps and debug toggles, and conforms to the AR-session and coaching-overlay delegates. Helper extensions decode mesh classification and add self-removing anchors. |
Delegate or data-source callbacks |
Cross-sample signals
Recurring documented patterns
| Pattern label | Sample documents |
|---|---|
| Delegate or data-source callbacks | 22 |
| View-controller organization | 13 |
| Protocol-oriented abstraction | 8 |
Type-role naming evidence
Counts below are declaration-name suffixes, not inferred patterns.
| Role suffix | Distinct declarations across samples |
|---|---|
Delegate |
47 |
Controller |
29 |
View |
12 |
App |
3 |
Session |
3 |
Provider |
3 |
Renderer |
3 |
Component |
3 |
Model |
3 |
System |
3 |
Coordinator |
1 |
Loader |
1 |
Processor |
1 |
Document |
1 |
Tracker |
1 |
Swift access-control evidence
These are declaration occurrences in scanned Swift source, including implicit internal declarations.
| Access level | Occurrences |
|---|---|
implicit internal |
3167 |
private |
347 |
private(set) |
20 |
fileprivate |
19 |
internal |
12 |
public |
11 |
References
Generated from the verified local catalog and completed Markdown documents.