One Logo Pool Ball
_RealityKit_SwiftUI · IOS API REFERENCE

RealityViewCameraContent

struct · iOS 18.0+ · SDK 27.1

struct RealityViewCameraContent

The content of a reality view that is displayed through a camera. On iOS, `RealityViewCameraContent` displays content in an AR camera view by default, and can display in a "non-AR" mode when requested or when AR or the device's camera is unavailable. On macOS, `RealityViewCameraContent` always displays its content in a non-AR mode. You can use `RealityViewCameraContent` to add and remove entities, subscribe to RealityKit events, configure the AR environment, and perform coordinate conversions such as projections and raycasts between the ``RealityView`` space and a SwiftUI View coordinate space.

Members (13)

get · iOS 18.0+

environment

TypeScript
get environment(): RealityViewEnvironment
Swift declaration
var environment: RealityViewEnvironment { get set }

The view’s background and default lighting properties.

set · iOS 18.0+

environment

TypeScript
set environment(value: RealityViewEnvironment)
Swift declaration
var environment: RealityViewEnvironment { get set }

The view’s background and default lighting properties.

get · iOS 18.0+

cameraTarget

TypeScript
get cameraTarget(): (_RealityFoundation_Entity) | null
Swift declaration
var cameraTarget: Entity? { get set }

The entity which an orbit camera targets.

set · iOS 18.0+

cameraTarget

TypeScript
set cameraTarget(value: (_RealityFoundation_Entity) | null)
Swift declaration
var cameraTarget: Entity? { get set }

The entity which an orbit camera targets.

get · iOS 18.0+

audioListener

TypeScript
get audioListener(): (_RealityFoundation_Entity) | null
Swift declaration
var audioListener: Entity? { get set }

The entity which defines the listener position and orientation for spatial audio. By default this `audioListener` property is nil, which means that the active camera entity will be used as the audio listener. The `audioListener` can be set to any entity in the `scene` to use the transform of the entity as the audio listener position and orientation.

set · iOS 18.0+

audioListener

TypeScript
set audioListener(value: (_RealityFoundation_Entity) | null)
Swift declaration
var audioListener: Entity? { get set }

The entity which defines the listener position and orientation for spatial audio. By default this `audioListener` property is nil, which means that the active camera entity will be used as the audio listener. The `audioListener` can be set to any entity in the `scene` to use the transform of the entity as the audio listener position and orientation.

get · iOS 18.0+

renderingEffects

TypeScript
get renderingEffects(): RealityViewRenderingEffects
Swift declaration
var renderingEffects: RealityViewRenderingEffects { get set }

The rendering options that you use to selectively enable or disable certain rendering effects.

set · iOS 18.0+

renderingEffects

TypeScript
set renderingEffects(value: RealityViewRenderingEffects)
Swift declaration
var renderingEffects: RealityViewRenderingEffects { get set }

The rendering options that you use to selectively enable or disable certain rendering effects.

get · iOS 18.0+

camera

TypeScript
get camera(): RealityViewCamera
Swift declaration
var camera: RealityViewCamera { get set }

The active camera for the RealityKit scene.

set · iOS 18.0+

camera

TypeScript
set camera(value: RealityViewCamera)
Swift declaration
var camera: RealityViewCamera { get set }

The active camera for the RealityKit scene.

method · iOS 26.0+

animate

TypeScript
animate(body: (() => void), completion?: ((() => void)) | null): Promise<void>
Swift declaration
@MainActor func animate(body: () -> Void, completion: (() -> Void)? = nil)
get · iOS 18.0+

entities

TypeScript
get entities(): RealityViewEntityCollection
Swift declaration
var entities: RealityViewEntityCollection { get nonmutating set }

A collection of RealityKit entities that this view content renders within the scene.

set · iOS 18.0+

entities

TypeScript
set entities(value: RealityViewEntityCollection)
Swift declaration
var entities: RealityViewEntityCollection { get nonmutating set }

A collection of RealityKit entities that this view content renders within the scene.

Skipped declarations

7 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

RealityViewCameraContent.project(point:to:)

This parameter hides a concrete Swift type.

RealityViewCameraContent.unproject(_:from:to:ontoPlane:)

This parameter hides a concrete Swift type.

RealityViewCameraContent.ray(through:in:to:)

This parameter hides a concrete Swift type.

RealityViewCameraContent.entity(at:in:)

This parameter hides a concrete Swift type.

RealityViewCameraContent.entities(at:in:)

This parameter hides a concrete Swift type.

RealityViewCameraContent.hitTest(point:in:query:mask:)

This parameter hides a concrete Swift type.

RealityViewCameraContent.subscribe(to:on:componentType:_:)

Passing a Swift type itself is not supported.

All _RealityKit_SwiftUI types →