environment
TypeScriptget environment(): RealityViewEnvironmentSwift declarationvar environment: RealityViewEnvironment { get set }The view’s background and default lighting properties.
struct · iOS 18.0+ · SDK 27.1
struct RealityViewCameraContentThe 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.
get environment(): RealityViewEnvironmentSwift declarationvar environment: RealityViewEnvironment { get set }The view’s background and default lighting properties.
set environment(value: RealityViewEnvironment)Swift declarationvar environment: RealityViewEnvironment { get set }The view’s background and default lighting properties.
get cameraTarget(): (_RealityFoundation_Entity) | nullSwift declarationvar cameraTarget: Entity? { get set }The entity which an orbit camera targets.
set cameraTarget(value: (_RealityFoundation_Entity) | null)Swift declarationvar cameraTarget: Entity? { get set }The entity which an orbit camera targets.
get audioListener(): (_RealityFoundation_Entity) | nullSwift declarationvar 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 audioListener(value: (_RealityFoundation_Entity) | null)Swift declarationvar 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 renderingEffects(): RealityViewRenderingEffectsSwift declarationvar renderingEffects: RealityViewRenderingEffects { get set }The rendering options that you use to selectively enable or disable certain rendering effects.
set renderingEffects(value: RealityViewRenderingEffects)Swift declarationvar renderingEffects: RealityViewRenderingEffects { get set }The rendering options that you use to selectively enable or disable certain rendering effects.
get camera(): RealityViewCameraSwift declarationvar camera: RealityViewCamera { get set }The active camera for the RealityKit scene.
set camera(value: RealityViewCamera)Swift declarationvar camera: RealityViewCamera { get set }The active camera for the RealityKit scene.
animate(body: (() => void), completion?: ((() => void)) | null): Promise<void>Swift declaration@MainActor func animate(body: () -> Void, completion: (() -> Void)? = nil)get entities(): RealityViewEntityCollectionSwift declarationvar entities: RealityViewEntityCollection { get nonmutating set }A collection of RealityKit entities that this view content renders within the scene.
set entities(value: RealityViewEntityCollection)Swift declarationvar entities: RealityViewEntityCollection { get nonmutating set }A collection of RealityKit entities that this view content renders within the scene.
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.