Skip to main content
API Reference NSDK

NSDKView

↳ inherits from RealityKit.ARView
Single view for both live and playback. Subclasses ARView; holds either an ARSession (live)...

Declaration

@MainActor class NSDKView

Summary

Single view for both live and playback. Subclasses ARView; holds either an ARSession (live) or PlaybackSession (playback) and exposes sessionMode, getCamera(), setDelegate(), setup(). Relation to Apple AR: Uses ARView; assigns either Apple's ARSession or our PlaybackSession to self.session so the view always has a "session." The app talks to NSDKView so it doesn't have to branch on live vs. playback for view, projection, viewport, or delegate callbacks.


Constructors

Constructor

@MainActor init()

Summary

Initializes the view in live AR mode with a new ARSession.
The session is assigned to the underlying ARView so ARKit drives the camera and tracking.


Overload

@MainActor init(dataset: PlaybackDataset)

Summary

Initializes the view in playback mode with a loaded dataset.
Uses a PlaybackSession and disables ARKit's automatic session configuration so playback drives the camera.


Properties

NameTypeSummary
@MainActor weak var delegateNSDKViewDelegate
Unified session delegate (live or playback).
Automatically forwards to the underlying ARSession or PlaybackSession.
@MainActor var hasDepthBool
Returns whether depth data is available for this session.
In playback, true if the dataset has LiDAR depth; in live, true if the device has a LiDAR sensor.
@MainActor var sessionModeSessionMode
The current session mode (live AR or playback). Switch on this to access the underlying ARSession or PlaybackSession.

Methods

NameTypeSummary
@MainActor getCameraNSDKCamera?
Returns a unified camera (NSDKCamera) for the current frame when one is available.
In live mode uses the current ARFrame's camera; in playback uses the current playback frame's camera.
Returns nil if no frame is ready. Use this so callers do not need to branch on session mode for view/projection/viewport.
@MainActor setupvoid
Adds the NSDKView to the given container and sets up playback rendering when in playback mode.
In playback, creates the PlaybackRenderer (background + camera) first so the camera image is drawn behind RealityKit content.
Call this after creating the NSDKView; the view is constrained to fill the container.

Nested Types

Enums

NameTypeSummary
SessionModeSessionMode
-

Relationships

conforms to: UIKit.UIUserActivityRestoring
conforms to: Foundation.NSCoding
conforms to: Swift.CustomDebugStringConvertible
conforms to: Swift.Hashable
conforms to: UIKit.UITraitChangeObservable

conforms to: ARKit.ARSessionProviding

conforms to: Swift.CustomStringConvertible
conforms to: Swift.Equatable
conforms to: UIKit.UIFocusItemContainer
conforms to: Swift.CVarArg
conforms to: UIKit.UIGestureRecognizerDelegate

conforms to: QuartzCore.CALayerDelegate

conforms to: UIKit.UIAccessibilityIdentification
conforms to: UIKit.UILargeContentViewerItem
conforms to: UIKit.UIPopoverPresentationControllerSourceItem

conforms to: ObjectiveC.NSObjectProtocol

conforms to: Swift.Sendable
conforms to: UIKit.UIFocusEnvironment
conforms to: UIKit.UIFocusItem
conforms to: UIKit.UICoordinateSpace
conforms to: UIKit.UITraitEnvironment
conforms to: UIKit.UIPasteConfigurationSupporting
conforms to: UIKit.UIDynamicItem
conforms to: UIKit.UIAppearanceContainer
conforms to: UIKit.UIAppearance
conforms to: UIKit.UIActivityItemsConfigurationProviding
conforms to: UIKit.UIResponderStandardEditActions