One Logo Pool Ball
Graphics and Games · IOS API REFERENCE

RealityKit

Simulate and render 3D content for use in your augmented reality apps.

56 types

263 callable entries

6 skipped

98% entry coverage

Generated from iOS SDK 27.1. Availability is shown on each declaration; permissions and entitlements still apply.

Types

AccessibilityComponent.RotorType

enum · iOS 17.0+

AccessibilityEvents

enum · iOS 17.0+

AccessibilityEvents.Activate

struct · iOS 17.0+

AccessibilityEvents.CustomAction

struct · iOS 17.0+

AccessibilityEvents.Decrement

struct · iOS 17.0+

AccessibilityEvents.Increment

struct · iOS 17.0+

AccessibilityEvents.RotorNavigation

struct · iOS 17.0+

ARKitAnchorComponent

struct · iOS 26.0+

ARView

class · iOS 13.0+

ARView.CameraMode

enum · iOS 13.0+

ARView.DebugOptions

struct · iOS 13.0+

ARView.DebugOptions.ArrayLiteralElement

typealias · iOS 13.0+

ARView.DebugOptions.Element

typealias · iOS 13.0+

ARView.DebugOptions.RawValue

typealias · iOS 13.0+

ARView.EntityGestures

struct · iOS 13.0+

ARView.EntityGestures.ArrayLiteralElement

typealias · iOS 13.0+

ARView.EntityGestures.Element

typealias · iOS 13.0+

ARView.EntityGestures.RawValue

typealias · iOS 13.0+

ARView.Environment

struct · iOS 13.0+

ARView.Environment.Background

struct · iOS 13.0+

ARView.Environment.Color

typealias · iOS 13.0+

ARView.Environment.ImageBasedLight

struct · iOS 13.0+

ARView.Environment.Reverb

enum · iOS 13.0+

ARView.Environment.Reverb.Preset

enum · iOS 13.0+

ARView.Environment.Reverb.Preset.AllCases

typealias · iOS 16.0+

ARView.Environment.SceneUnderstanding

struct · iOS 13.4+

ARView.Environment.SceneUnderstanding.Options

struct · iOS 13.4+

ARView.Environment.SceneUnderstanding.Options.ArrayLiteralElement

typealias · iOS 13.4+

ARView.Environment.SceneUnderstanding.Options.Element

typealias · iOS 13.4+

ARView.Environment.SceneUnderstanding.Options.RawValue

typealias · iOS 13.4+

ARView.Image

typealias · iOS 13.0+

ARView.PostProcessContext

struct · iOS 15.0+

ARView.RenderCallbacks

struct · iOS 15.0+

ARView.RenderOptions

struct · iOS 13.0+

ARView.RenderOptions.ArrayLiteralElement

typealias · iOS 13.0+

ARView.RenderOptions.Element

typealias · iOS 13.0+

ARView.RenderOptions.RawValue

typealias · iOS 13.0+

ARViewBase

typealias · iOS 13.0+

DirectionalLightComponent.Color

typealias · iOS 13.0+

EntityGestureRecognizer

protocol · iOS 13.0+

EntityRotationGestureRecognizer

class · iOS 13.0+

EntityScaleGestureRecognizer

class · iOS 13.0+

EntityTranslationGestureRecognizer

class · iOS 13.0+

Material.Color

typealias · iOS 13.0+

MaterialColorParameter

enum · iOS 13.0+

MeshResource.Font

typealias · iOS 13.0+

MultipeerConnectivityService

class · iOS 13.0+

ParticleEmitterComponent.ParticleEmitter.Color

typealias · iOS 18.0+

ParticleEmitterComponent.ParticleEmitter.ParticleColor

enum · iOS 18.0+

ParticleEmitterComponent.ParticleEmitter.ParticleColor.ColorValue

enum · iOS 18.0+

ParticleEmitterComponent.Presets

struct · iOS 18.0+

ParticleEmitterComponent.Timing

enum · iOS 18.0+

ParticleEmitterComponent.Timing.VariableDuration

struct · iOS 18.0+

PointLightComponent.Color

typealias · iOS 13.0+

SpotLightComponent.Color

typealias · iOS 13.0+

TextComponent.EdgeInsets

typealias · iOS 18.0+

Functions and constants

init · iOS 13.0+

init

TypeScript
static initRaycastResult(raycastResult: _ARKit_ARRaycastResult): Promise<_RealityFoundation_AnchorEntity>
Swift declaration
@MainActor @preconcurrency convenience init(raycastResult: ARRaycastResult)

Creates an anchor entity using the information about a real-world surface discovered using a ray-cast query. - Parameters: - raycastResult: The ray-cast result.

init · iOS 13.0+

init

TypeScript
static initAnchor(anchor: _ARKit_ARAnchor): Promise<_RealityFoundation_AnchorEntity>
Swift declaration
@MainActor @preconcurrency convenience init(anchor: ARAnchor)

Creates an anchor entity that uses an existing AR anchor. - Parameters: - anchor: An existing <doc://com.apple.documentation/documentation/arkit/aranchor> instance.

static · iOS 18.0+

generateStaticMesh

TypeScript
static generateStaticMesh(meshAnchor: _ARKit_ARMeshAnchor): Promise<_RealityFoundation_ShapeResource>
Swift declaration
nonisolated static func generateStaticMesh(from meshAnchor: ARMeshAnchor) async throws -> ShapeResource

Creates a mesh-based collision shape derived from an ARKit Scene Understanding mesh anchor. The returned `ShapeResource` can only be used under the following circumstances: - This shape can only be used with `PhysicsBodyMode.static` (not `.dynamic` or `.kinematic`) - This shape cannot be used with `CollisionComponent.Mode.trigger` In other words, the returned shape can only be used for static world geometry. - Note: Generating a shape resource from the AR mesh takes time, because the input mesh needs to be preprocessed ("cooked") by the physics engine before it can be used. This function is marked `async` because ideally this precomputation should occur in the background. For example, when calling from non-`async` code, you can use Swift's `Task` API to assign a priority (see the example below). Below is example usage of this function, assumed to be called from a non-async block: ```swift let myAnchor: ARMeshAnchor = ... // It is recommended to use a low-priority task, since generating the collision mesh can take a while. let myShapeTask = Task(priority: .low) { let shape = await ShapeResource.generateStaticMesh(from: myAnchor) // Now we can do something with `shape`, such as create an entity with it. // Make sure to call non-async RealityKit methods from the main actor: await MainActor.run { let entity = Entity() entity.components[CollisionComponent.self] = .init(shapes: [shape]) // Note that `mode` can not be set to `.dynamic`. Only `.static` is supported. entity.components[PhysicsBodyComponent.self] = .init(massProperties: .default, material: nil, mode: .static) // ... } } ``` - Parameters: - meshAnchor: The mesh anchor which will be used for the collision shape. This anchor needs to have `meshAnchor.geometry.faces.primitiveType == ARGeometryPrimitiveTypeTriangle`. - Returns: The new shape.

get · iOS 18.0+

edgeInsets

TypeScript
get edgeInsets(): { top: number; left: number; bottom: number; right: number }
Swift declaration
var edgeInsets: TextComponent.EdgeInsets { get set }
set · iOS 18.0+

edgeInsets

TypeScript
set edgeInsets(value: { top: number; left: number; bottom: number; right: number })
Swift declaration
var edgeInsets: TextComponent.EdgeInsets { get set }
init · iOS 18.0+

init

TypeScript
static initColorApplyPostProcessToneMap(color: _UIKit_UIColor, applyPostProcessToneMap: boolean): _RealityFoundation_UnlitMaterial
Swift declaration
init(color: UIColor, applyPostProcessToneMap: Bool)

Creates an UnlitMaterial with the given color and tone mapping setting

init · iOS 13.0+

init

TypeScript
static initColor(color: _UIKit_UIColor): _RealityFoundation_UnlitMaterial
Swift declaration
init(color: UIColor)

Creates an unlit material with the given base color. - Parameters: - color: The base color for the new material. - Note: The blending mode of `UnlitMaterial` materials should be configured explicitly with the ``UnlitMaterial/blending-swift.property`` property for transparent or translucent surfaces. The `opaque` mode is used when unset.

get · iOS 13.0+ · Deprecated in iOS 15.0

baseColor

TypeScript
get baseColor(): MaterialColorParameter
Swift declaration
var baseColor: MaterialColorParameter { get set }

The base color of the material.

set · iOS 13.0+ · Deprecated in iOS 15.0

baseColor

TypeScript
set baseColor(value: MaterialColorParameter)
Swift declaration
var baseColor: MaterialColorParameter { get set }

The base color of the material.

get · iOS 13.0+ · Deprecated in iOS 15.0

tintColor

TypeScript
get tintColor(): _UIKit_UIColor
Swift declaration
var tintColor: UIColor { get set }

A tint color applied to the base color.

set · iOS 13.0+ · Deprecated in iOS 15.0

tintColor

TypeScript
set tintColor(value: _UIKit_UIColor)
Swift declaration
var tintColor: UIColor { get set }

A tint color applied to the base color.

init · iOS 15.0+

init

TypeScript
static init(color?: _UIKit_UIColor, texture?: (_RealityFoundation_CustomMaterial_CustomMaterialTexture) | null): _RealityFoundation_CustomMaterial_EmissiveColor
Swift declaration
init(color: UIColor = .black, texture: CustomMaterial.Texture? = nil)

Creates a color of emitted light in macOS. - Parameters: - color: The color of the emitted light. Defaults to black. - texture: An optional UV-mapped image texture.

get · iOS 15.0+

color

TypeScript
get color(): _UIKit_UIColor
Swift declaration
var color: UIColor { get set }
set · iOS 15.0+

color

TypeScript
set color(value: _UIKit_UIColor)
Swift declaration
var color: UIColor { get set }
init · iOS 15.0+

init

TypeScript
static init(tint?: _UIKit_UIColor, texture?: (_RealityFoundation_CustomMaterial_CustomMaterialTexture) | null): _RealityFoundation_CustomMaterial_BaseColor
Swift declaration
init(tint: UIColor = .white, texture: CustomMaterial.Texture? = nil)

Creates a base color object from a color or texture on macOS. This initializer creates a new object from a color or image texture, or from both. If you don’t provide a `tint` color, `tint` defaults to white. Both tint and texture are available to use in your surface shader function, but RealityKit doesn’t automatically use them to render the entity. Your surface shader calculates the final base color value for each pixel and assigns it by calling `params.surface().set_base_color()`. For more information on creating custom materials and writing shader functions, see <doc:modifying-realitykit-rendering-using-custom-materials>. - Parameters: - tint: The tint color. Defaults to white. - texture: An optional image texture.

get · iOS 15.0+

tint

TypeScript
get tint(): _UIKit_UIColor
Swift declaration
var tint: UIColor { get set }
set · iOS 15.0+

tint

TypeScript
set tint(value: _UIKit_UIColor)
Swift declaration
var tint: UIColor { get set }
init · iOS 13.0+

init

TypeScript
static init(color: _UIKit_UIColor, roughness: _RealityFoundation_MaterialScalarParameter, isMetallic: boolean): _RealityFoundation_SimpleMaterial
Swift declaration
init(color: SimpleMaterial.Color, roughness: MaterialScalarParameter = 0.0, isMetallic: Bool)

Creates a simple material with specific characteristics in macOS. - Parameters: - color: The color of the material. - roughness: The roughness of the material. - isMetallic: A Boolean indicating whether the material should have a metallic appearance.

get · iOS 13.0+ · Deprecated in iOS 15.0

baseColor

TypeScript
get baseColor(): MaterialColorParameter
Swift declaration
var baseColor: MaterialColorParameter { get set }

The base color of the material.

set · iOS 13.0+ · Deprecated in iOS 15.0

baseColor

TypeScript
set baseColor(value: MaterialColorParameter)
Swift declaration
var baseColor: MaterialColorParameter { get set }

The base color of the material.

get · iOS 13.0+ · Deprecated in iOS 15.0

tintColor

TypeScript
get tintColor(): _UIKit_UIColor
Swift declaration
var tintColor: UIColor { get set }

A tint color applied to the base color in macOS.

set · iOS 13.0+ · Deprecated in iOS 15.0

tintColor

TypeScript
set tintColor(value: _UIKit_UIColor)
Swift declaration
var tintColor: UIColor { get set }

A tint color applied to the base color in macOS.

static · iOS 15.0+

load

TypeScript
static loadNamedInOptions(name: string, bundle: (_Foundation_Bundle) | null, options: _RealityFoundation_TextureResource_CreateOptions): Promise<_RealityFoundation_TextureResource>
Swift declaration
@MainActor @preconcurrency static func load(named name: String, in bundle: Bundle? = nil, options: TextureResource.CreateOptions) throws -> TextureResource

Returns a texture resource by synchronously loading it from a bundle with options. Loading a ``TextureResource`` with this method blocks the main actor because it’s synchronous, so only call it from a command-line application. The method can stall a regular app, which makes it visibly hitch, and the system terminates an app if its UI becomes unresponsive. See ``init(named:in:)`` for an example that demonstrates how to safely load content. This method loads the image that the `URL` specifies, and creates a texture resource from it. The method blocks until it finishes loading the image and creating the texture resource. RealityKit automatically creates a resource name based on the `name` and `bundle` values. RealityKit uses the resource name to identify resources, and to match texture resources between networked peers. Specify a unique name for each texture resource you load or generate. - Parameters: - name: The name of the resource. The filename extension is optional. - bundle: The bundle to search for the resource. Use `nil` to indicate the app’s bundle. - options: Configurable options that affect texture loading. - Returns: The loaded resource.

static · iOS 13.0+

load

TypeScript
static loadNamedIn(name: string, bundle?: (_Foundation_Bundle) | null): Promise<_RealityFoundation_TextureResource>
Swift declaration
@MainActor @preconcurrency static func load(named name: String, in bundle: Bundle? = nil) throws -> TextureResource

Returns a texture resource by synchronously loading it from a bundle. Loading a ``TextureResource`` with this method blocks the main actor because it’s synchronous, so only call it from a command-line application. The method can stall a regular app, which makes it visibly hitch, and the system terminates an app if its UI becomes unresponsive. See ``init(named:in:)`` for an example that demonstrates how to safely load content. This method loads the image that the `URL` specifies, and creates a texture resource from it. The method blocks until it finishes loading the image and creating the texture resource. RealityKit automatically creates a resource name based on the `name` and `bundle` values. RealityKit uses the resource name to identify texture resources, and to match texture resources between networked peers. Specify a unique resource name for each texture resource you load or generate. - Parameters: - name: The name of the resource. The filename extension is optional. - bundle: The bundle to search for the resource. Use `nil` to indicate the app’s bundle. - Returns: The loaded resource.

init · iOS 18.0+

init

TypeScript
static initNamedInOptions(name: string, bundle: (_Foundation_Bundle) | null, options: _RealityFoundation_TextureResource_CreateOptions): Promise<_RealityFoundation_TextureResource>
Swift declaration
@MainActor @preconcurrency convenience init(named name: String, in bundle: Bundle? = nil, options: TextureResource.CreateOptions) async throws

Asynchronously loads a texture resource from a bundle with options. RealityKit automatically creates a resource name for the texture resource based on the values of `name` and `bundle`. RealityKit uses the resource name to identify resources, and to match texture resources between networked peers. Specify a unique name for each texture resource you load or generate. See ``init(named:in:)`` for an example of optimally loading textures with other content. - Parameters: - name: The name of the resource. The filename extension is optional. - bundle: The bundle to search for the resource. Use `nil` to indicate the app’s bundle. - options: Configuration options for texture creation.

init · iOS 18.0+

init

TypeScript
static initNamedIn(name: string, bundle?: (_Foundation_Bundle) | null): Promise<_RealityFoundation_TextureResource>
Swift declaration
@MainActor @preconcurrency convenience init(named name: String, in bundle: Bundle? = nil) async throws

Asynchronously loads a texture resource from a bundle. RealityKit automatically creates a resource name for the texture resource based on the values of `name` and `bundle`. RealityKit uses the resource name to identify resources, and to match texture resources between networked peers. Specify a unique name for each texture resource you load or generate. Load textures concurrently with other content for optimal load times without causing your app to hitch. ```swift struct SomeRealityView: View { var body: some View { RealityView { content in // Begin loading the texture. async let textureA = try? TextureResource(named:"textureA.jpg") // Load the scene. guard let rootEntity = try? await Entity(named: "SceneA", in: realityKitContentBundle) else { return } // Wait for the texture to finish loading. guard let textureA = await textureA else { return } // Create and assign a material that uses the texture to a model entity. if let entityA = rootEntity.findEntity(named: "ModelA") as? ModelEntity { var material = PhysicallyBasedMaterial() material.baseColor = PhysicallyBasedMaterial.BaseColor(tint: .white, texture: .init(textureA)) entityA.model?.materials[0] = material } content.add(rootEntity) } } } ``` - Parameters: - name: The name of the resource. The filename extension is optional. - bundle: The bundle to search for the resource. Use `nil` to indicate the app’s bundle.

static · iOS 15.0+ · Deprecated in iOS 18.0

loadAsync

TypeScript
static loadAsyncNamedInOptions(name: string, bundle: (_Foundation_Bundle) | null, options: _RealityFoundation_TextureResource_CreateOptions): Promise<_RealityFoundation_LoadRequest<_RealityFoundation_TextureResource>>
Swift declaration
@MainActor @preconcurrency static func loadAsync(named name: String, in bundle: Bundle? = nil, options: TextureResource.CreateOptions) -> LoadRequest<TextureResource>

Returns a load request that creates a texture resource by asynchronously loading it from a bundle with options. RealityKit automatically creates a resource name for the texture resource based on the values of `name` and `bundle`. RealityKit uses the resource name to identify resources, and to match texture resources between networked peers. Specify a unique name for each texture resource you load or generate. See ``init(named:in:)`` for an example of optimally loading textures with other content. - Parameters: - name: The name of the resource. The filename extension is optional. - bundle: The bundle to search for the resource. Use `nil` to indicate the app’s bundle. - options: Configuration options for texture creation. - Returns: A load operation that publishes the resource.

static · iOS 13.0+ · Deprecated in iOS 18.0

loadAsync

TypeScript
static loadAsyncNamedIn(name: string, bundle?: (_Foundation_Bundle) | null): Promise<_RealityFoundation_LoadRequest<_RealityFoundation_TextureResource>>
Swift declaration
@MainActor @preconcurrency static func loadAsync(named name: String, in bundle: Bundle? = nil) -> LoadRequest<TextureResource>

Returns a load request that creates a texture resource by asynchronously loading it from a bundle. RealityKit automatically creates a resource name for the texture resource based on the values of `name` and `bundle`. RealityKit uses the resource name to identify resources, and to match texture resources between networked peers. Specify a unique name for each texture resource you load or generate. See ``init(named:in:)`` for an example of optimally loading textures with other content. - Parameters: - name: The name of the resource. The filename extension is optional. - bundle: The bundle to search for the resource. Use `nil` to indicate the app’s bundle. - Returns: A load operation that publishes the resource.

init · iOS 13.0+

init

TypeScript
static init(anchor: _ARKit_ARAnchor): _RealityFoundation_AnchoringComponent
Swift declaration
init(_ anchor: ARAnchor)

Creates an anchoring component with the given AR anchor. - Parameters: - anchor: An existing AR anchor to use.

get · iOS 18.0+

colorValue

TypeScript
get colorValue(): (_UIKit_UIColor) | null
Swift declaration
var colorValue: UIColor? { get }
static · iOS 18.0+

color

TypeScript
static color(color: _UIKit_UIColor): _RealityFoundation_MaterialParameters_Value
Swift declaration
static func color(_ color: UIColor) -> MaterialParameters.Value
init · iOS 18.0+

init

TypeScript
static initColorIntensityInnerAngleInDegreesOuterAngleInDegreesAttenuationRadiusAttenuationFalloffExponent(color?: _UIKit_UIColor, intensity?: number, innerAngleInDegrees?: number, outerAngleInDegrees?: number, attenuationRadius?: number, attenuationFalloffExponent?: number): _RealityFoundation_SpotLightComponent
Swift declaration
init(color: SpotLightComponent.Color = .white, intensity: Float = 6740.94, innerAngleInDegrees: Float = 45.0, outerAngleInDegrees: Float = 60.0, attenuationRadius: Float = 10.0, attenuationFalloffExponent: Float = 2.0)

Creates a spotlight with the given parameters. - Parameters: - color: The color of the light. - intensity: The light's brightness. - innerAngleInDegrees: The angle of the cone that emits light at full intensity, in degrees. - outerAngleInDegrees: The angle of the cone beyond which the spotlight's intensity is zero. - attenuationRadius: The distance from the light source where its intensity reaches zero. Any objects at or beyond this distance do not receive illumination. - attenuationFalloffExponent: An exponent value for the light's intensity falloff-transition curve.

init · iOS 13.0+

init

TypeScript
static initColorIntensityInnerAngleInDegreesOuterAngleInDegreesAttenuationRadius(color?: _UIKit_UIColor, intensity?: number, innerAngleInDegrees?: number, outerAngleInDegrees?: number, attenuationRadius?: number): _RealityFoundation_SpotLightComponent
Swift declaration
init(color: SpotLightComponent.Color = .white, intensity: Float = 6740.94, innerAngleInDegrees: Float = 45.0, outerAngleInDegrees: Float = 60.0, attenuationRadius: Float = 10.0)

Creates a spotlight with the given parameters. - Parameters: - color: The color of the light. - intensity: The light's brightness. - innerAngleInDegrees: The angle of the cone that emits light at full intensity, in degrees. - outerAngleInDegrees: The angle of the cone beyond which the spotlight's intensity is zero. - attenuationRadius: The distance from the light source where its intensity reaches zero. Any objects at or beyond this distance do not receive illumination.

get · iOS 13.0+

color

TypeScript
get color(): _UIKit_UIColor
Swift declaration
var color: SpotLightComponent.Color { get set }

A color for the spotlight.

set · iOS 13.0+

color

TypeScript
set color(value: _UIKit_UIColor)
Swift declaration
var color: SpotLightComponent.Color { get set }

A color for the spotlight.

init · iOS 18.0+

init

TypeScript
static initColorIntensityAttenuationRadiusAttenuationFalloffExponent(color?: _UIKit_UIColor, intensity?: number, attenuationRadius?: number, attenuationFalloffExponent?: number): _RealityFoundation_PointLightComponent
Swift declaration
init(color: PointLightComponent.Color = .white, intensity: Float = 26963.76, attenuationRadius: Float = 10.0, attenuationFalloffExponent: Float = 2.0)

Creates a point light component with a configuration. - Parameters: - color: The color of the light. - intensity: The intensity of the light in lumens. - attenuationRadius: The distance from the light source where its intensity reaches zero. Any objects at or beyond this distance do not receive illumination. - attenuationFalloffExponent: An exponent value for the light's intensity falloff-transition curve.

init · iOS 13.0+

init

TypeScript
static initColorIntensityAttenuationRadius(color?: _UIKit_UIColor, intensity?: number, attenuationRadius?: number): _RealityFoundation_PointLightComponent
Swift declaration
init(color: PointLightComponent.Color = .white, intensity: Float = 26963.76, attenuationRadius: Float = 10.0)

Creates a point light component with a configuration. - Parameters: - color: The color of the light. - intensity: The intensity of the light in lumens. - attenuationRadius: The distance from the light source where its intensity reaches zero. Any objects at or beyond this distance do not receive illumination.

get · iOS 13.0+

color

TypeScript
get color(): _UIKit_UIColor
Swift declaration
var color: PointLightComponent.Color { get set }

A color for the point light.

set · iOS 13.0+

color

TypeScript
set color(value: _UIKit_UIColor)
Swift declaration
var color: PointLightComponent.Color { get set }

A color for the point light.

init · iOS 18.0+

init

TypeScript
static initColorStrengthOpacityFunction(color: (_UIKit_UIColor) | null, strength: number, opacityFunction: _RealityFoundation_HoverEffectComponent_OpacityFunction): _RealityFoundation_HoverEffectComponent_HighlightHoverEffectStyle
Swift declaration
init(color: UIColor? = nil, strength: Float = 1.0, opacityFunction: HoverEffectComponent.OpacityFunction)

Creates a new highlight effect with a color and strength.

init · iOS 18.0+

init

TypeScript
static initColorStrength(color?: (_UIKit_UIColor) | null, strength?: number): _RealityFoundation_HoverEffectComponent_HighlightHoverEffectStyle
Swift declaration
init(color: UIColor? = nil, strength: Float = 1.0)

Creates a new highlight effect with a color and strength.

get · iOS 18.0+

color

TypeScript
get color(): _UIKit_UIColor
Swift declaration
var color: UIColor { get set }

The color tint for the highlight hover effect.

set · iOS 18.0+

color

TypeScript
set color(value: _UIKit_UIColor)
Swift declaration
var color: UIColor { get set }

The color tint for the highlight hover effect.

init · iOS 18.0+

init

TypeScript
static initColorStrengthOpacityFunction(color: (_UIKit_UIColor) | null, strength: number, opacityFunction: _RealityFoundation_HoverEffectComponent_OpacityFunction): _RealityFoundation_HoverEffectComponent_SpotlightHoverEffectStyle
Swift declaration
init(color: UIColor? = nil, strength: Float = 1.0, opacityFunction: HoverEffectComponent.OpacityFunction)

Creates a new spotlight effect with a color and strength.

init · iOS 18.0+

init

TypeScript
static initColorStrength(color?: (_UIKit_UIColor) | null, strength?: number): _RealityFoundation_HoverEffectComponent_SpotlightHoverEffectStyle
Swift declaration
init(color: UIColor? = nil, strength: Float = 1.0)

Creates a new spotlight effect with a color and strength.

get · iOS 18.0+

color

TypeScript
get color(): _UIKit_UIColor
Swift declaration
var color: UIColor { get set }

The color tint for the spotlight hover effect.

set · iOS 18.0+

color

TypeScript
set color(value: _UIKit_UIColor)
Swift declaration
var color: UIColor { get set }

The color tint for the spotlight hover effect.

get · iOS 17.0+

customRotors

TypeScript
get customRotors(): Array<AccessibilityComponent_RotorType>
Swift declaration
var customRotors: [AccessibilityComponent.RotorType] { get set }

An array of supported rotors.

set · iOS 17.0+

customRotors

TypeScript
set customRotors(value: Array<AccessibilityComponent_RotorType>)
Swift declaration
var customRotors: [AccessibilityComponent.RotorType] { get set }

An array of supported rotors.

get · iOS 17.0+

traits

TypeScript
get traits(): _UIKit_UIAccessibilityTraits
Swift declaration
var traits: UIAccessibilityTraits { get set }

The combination of accessibility traits that best characterize the entity.

set · iOS 17.0+

traits

TypeScript
set traits(value: _UIKit_UIAccessibilityTraits)
Swift declaration
var traits: UIAccessibilityTraits { get set }

The combination of accessibility traits that best characterize the entity.

init · iOS 15.0+

init

TypeScript
static init(tint?: _UIKit_UIColor, texture?: (_RealityFoundation_MaterialParameters_Texture) | null): _RealityFoundation_PhysicallyBasedMaterial_SheenColor
Swift declaration
init(tint: UIColor = .white, texture: MaterialParameters.Texture? = nil)

Creates a sheen color in macOS. This initializer creates an object from a color, an image texture, or from both. If you don’t provide a `tint` color, `tint` defaults to white. If you specify `texture`, RealityKit calculates the final sheen color for the entity by UV-mapping `texture` onto the entity and then multiplying the color at any given pixel by `tint`. If `tint` is white, RealityKit uses the texture untinted. If you don’t specify `texture`, then RealityKit uses `tint` as the entity’s sheen color. - Parameters: - tint: The tint color. - texture: The optional image texture.

get · iOS 15.0+

tint

TypeScript
get tint(): _UIKit_UIColor
Swift declaration
var tint: UIColor { get set }
set · iOS 15.0+

tint

TypeScript
set tint(value: _UIKit_UIColor)
Swift declaration
var tint: UIColor { get set }
init · iOS 15.0+

init

TypeScript
static init(color?: _UIKit_UIColor, texture?: (_RealityFoundation_MaterialParameters_Texture) | null): _RealityFoundation_PhysicallyBasedMaterial_EmissiveColor
Swift declaration
init(color: UIColor = .black, texture: MaterialParameters.Texture? = nil)

Creates a color of emitted light in iOS. This initializer creates an object from a color, an image texture, or from both. The `color` property defaults to black, which results in no light emissions. With custom materials, `color` and `texture` are available as inputs in your surface shader, but your surface shader must call `params.surface().set_emissive_color()`, otherwise RealityKit renders no light emission. The following Metal code demonstrates how to replicate the emissive behavior of ``PhysicallyBasedMaterial`` in your surface shader code: ```swift // Retrieve the emissive color tint from the CustomMaterial. half3 emissiveColorTint = (half3)params.material_constants() .emissive_color_tint(); // Retrieve the primary texture coordinates. float2 uv = params.geometry().uv0(); // Flip the UV coordinate’s y-axis. You only need to do this // for models you load from USDZ or .reality files. uv.y = 1.0 - uv.y; auto tex = params.textures(); half3 color = (half3)tex.emissive_color() .sample(textureSampler, uv).rgb; // Multiply the tint and the sampled value from the texture, // and assign the result to the shader's emissive color // property. color *= emissiveColorTint; params.surface().set_emissive_color(color); ``` - Note: Unlike ``PhysicallyBasedMaterial``, ``CustomMaterial`` has no ``PhysicallyBasedMaterial/emissiveIntensity`` value. If you need to pass an emissive intensity value to your surface shader, use the ``CustomMaterial/custom-swift.property`` property or another unused attribute property. - Parameters: - color: The color of the emitted light. Defaults to black. - texture: An optional UV-mapped image texture.

get · iOS 15.0+

color

TypeScript
get color(): _UIKit_UIColor
Swift declaration
var color: UIColor { get set }
set · iOS 15.0+

color

TypeScript
set color(value: _UIKit_UIColor)
Swift declaration
var color: UIColor { get set }
init · iOS 15.0+

init

TypeScript
static init(tint?: _UIKit_UIColor, texture?: (_RealityFoundation_MaterialParameters_Texture) | null): _RealityFoundation_PhysicallyBasedMaterial_BaseColor
Swift declaration
init(tint: UIColor = .white, texture: MaterialParameters.Texture? = nil)

Creates a base color object from a color or texture on macOS. This initializer creates a new instance from a color or image texture, or from both. If you don’t provide a `tint` color, `tint` defaults to white. If you specify `texture`, RealityKit calculates the final base color for the entity by UV-mapping `texture` onto the entity and then multiplying the color at any given pixel by `tint`. If `tint` is white, RealityKit renders the textured untinted. If you don’t specify a texture, RealityKit uses `tint` as the entity’s base color. - Parameters: - tint: The tint color. Defaults to white. - texture: An optional image texture.

get · iOS 15.0+

tint

TypeScript
get tint(): _UIKit_UIColor
Swift declaration
var tint: UIColor { get set }
set · iOS 15.0+

tint

TypeScript
set tint(value: _UIKit_UIColor)
Swift declaration
var tint: UIColor { get set }
get · iOS 18.0+

timing

TypeScript
get timing(): ParticleEmitterComponent_Timing
Swift declaration
var timing: ParticleEmitterComponent.Timing { get set }

Defines the Emitter timing method.

set · iOS 18.0+

timing

TypeScript
set timing(value: ParticleEmitterComponent_Timing)
Swift declaration
var timing: ParticleEmitterComponent.Timing { get set }

Defines the Emitter timing method.

get · iOS 18.0+

color

TypeScript
get color(): ParticleEmitterComponent_ParticleEmitter_ParticleColor
Swift declaration
var color: ParticleEmitterComponent.ParticleEmitter.ParticleColor { get set }

The color of particles.

set · iOS 18.0+

color

TypeScript
set color(value: ParticleEmitterComponent_ParticleEmitter_ParticleColor)
Swift declaration
var color: ParticleEmitterComponent.ParticleEmitter.ParticleColor { get set }

The color of particles.

init · iOS 13.0+

init

TypeScript
static init(color?: _UIKit_UIColor, intensity?: number, isRealWorldProxy?: boolean): _RealityFoundation_DirectionalLightComponent
Swift declaration
init(color: DirectionalLightComponent.Color = .white, intensity: Float = 2145.7078, isRealWorldProxy: Bool = false)

Creates a directional light with a configuration. - Parameters: - color: A color for the light. - intensity: The intensity of the light, measured in lumen per square meter. - isRealWorldProxy: A Boolean that you use to control whether the light operates as a proxy for a real-world light.

get · iOS 13.0+

color

TypeScript
get color(): _UIKit_UIColor
Swift declaration
var color: DirectionalLightComponent.Color { get set }

A color for the directional light.

set · iOS 13.0+

color

TypeScript
set color(value: _UIKit_UIColor)
Swift declaration
var color: DirectionalLightComponent.Color { get set }

A color for the directional light.

get · iOS 17.0+

accessibilityValue

TypeScript
get accessibilityValue(): Promise<(_Foundation_LocalizedStringResource) | null>
Swift declaration
@MainActor @preconcurrency var accessibilityValue: LocalizedStringResource? { get set }

A localized string key that represents the current value of the entity.

set · iOS 17.0+

accessibilityValue

TypeScript
setAccessibilityValue(value?: (_Foundation_LocalizedStringResource) | null): Promise<void>
Swift declaration
@MainActor @preconcurrency var accessibilityValue: LocalizedStringResource? { get set }

A localized string key that represents the current value of the entity.

get · iOS 17.0+

accessibilityTraits

TypeScript
get accessibilityTraits(): Promise<_UIKit_UIAccessibilityTraits>
Swift declaration
@MainActor @preconcurrency var accessibilityTraits: UIAccessibilityTraits { get set }

The combination of accessibility traits that best characterize the entity.

set · iOS 17.0+

accessibilityTraits

TypeScript
setAccessibilityTraits(value: _UIKit_UIAccessibilityTraits): Promise<void>
Swift declaration
@MainActor @preconcurrency var accessibilityTraits: UIAccessibilityTraits { get set }

The combination of accessibility traits that best characterize the entity.

get · iOS 17.0+

accessibilityLabelKey

TypeScript
get accessibilityLabelKey(): Promise<(_Foundation_LocalizedStringResource) | null>
Swift declaration
@MainActor @preconcurrency var accessibilityLabelKey: LocalizedStringResource? { get set }

A succinct label that identifies the entity, in a localized string key.

set · iOS 17.0+

accessibilityLabelKey

TypeScript
setAccessibilityLabelKey(value?: (_Foundation_LocalizedStringResource) | null): Promise<void>
Swift declaration
@MainActor @preconcurrency var accessibilityLabelKey: LocalizedStringResource? { get set }

A succinct label that identifies the entity, in a localized string key.

get · iOS 17.0+

accessibilityCustomRotors

TypeScript
get accessibilityCustomRotors(): Promise<Array<AccessibilityComponent_RotorType>>
Swift declaration
@MainActor @preconcurrency var accessibilityCustomRotors: [AccessibilityComponent.RotorType] { get set }

An array of supported rotors.

set · iOS 17.0+

accessibilityCustomRotors

TypeScript
setAccessibilityCustomRotors(value: Array<AccessibilityComponent_RotorType>): Promise<void>
Swift declaration
@MainActor @preconcurrency var accessibilityCustomRotors: [AccessibilityComponent.RotorType] { get set }

An array of supported rotors.

get · iOS 17.0+

accessibilityCustomActions

TypeScript
get accessibilityCustomActions(): Promise<Array<_Foundation_LocalizedStringResource>>
Swift declaration
@MainActor @preconcurrency var accessibilityCustomActions: [LocalizedStringResource] { get set }

An array of custom actions supported by the entity, identified by their localized string key.

set · iOS 17.0+

accessibilityCustomActions

TypeScript
setAccessibilityCustomActions(value: Array<_Foundation_LocalizedStringResource>): Promise<void>
Swift declaration
@MainActor @preconcurrency var accessibilityCustomActions: [LocalizedStringResource] { get set }

An array of custom actions supported by the entity, identified by their localized string key.

get · iOS 17.0+

accessibilityCustomContent

TypeScript
get accessibilityCustomContent(): Promise<Array<_RealityFoundation_AccessibilityComponent_CustomContent>>
Swift declaration
@MainActor @preconcurrency var accessibilityCustomContent: [AccessibilityComponent.CustomContent] { get set }

The Custom Content API is useful for delivering accessibility information from complex data sets to your users in measured portions. Using this API allows you to leverage assistive technologies to present only the accessible content your app’s users need, when they need it.

set · iOS 17.0+

accessibilityCustomContent

TypeScript
setAccessibilityCustomContent(value: Array<_RealityFoundation_AccessibilityComponent_CustomContent>): Promise<void>
Swift declaration
@MainActor @preconcurrency var accessibilityCustomContent: [AccessibilityComponent.CustomContent] { get set }

The Custom Content API is useful for delivering accessibility information from complex data sets to your users in measured portions. Using this API allows you to leverage assistive technologies to present only the accessible content your app’s users need, when they need it.

get · iOS 17.0+

accessibilitySystemActions

TypeScript
get accessibilitySystemActions(): Promise<_RealityFoundation_AccessibilityComponent_SupportedActions>
Swift declaration
@MainActor @preconcurrency var accessibilitySystemActions: AccessibilityComponent.SupportedActions { get set }

The set of supported accessibility actions.

set · iOS 17.0+

accessibilitySystemActions

TypeScript
setAccessibilitySystemActions(value: _RealityFoundation_AccessibilityComponent_SupportedActions): Promise<void>
Swift declaration
@MainActor @preconcurrency var accessibilitySystemActions: AccessibilityComponent.SupportedActions { get set }

The set of supported accessibility actions.

Skipped declarations

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

ARView.Environment.sceneUnderstanding

The iOS SDK compiler rejected this binding: cannot use mutating getter on immutable value: 'o' is a 'let' constant

EntityRotationGestureRecognizer.init(target:action:)

Objective-C selectors cannot cross the bridge.

EntityScaleGestureRecognizer.init(target:action:)

Objective-C selectors cannot cross the bridge.

EntityTranslationGestureRecognizer.init(target:action:)

Objective-C selectors cannot cross the bridge.

MeshResource.generateText(_:extrusionDepth:font:containerFrame:alignment:lineBreakMode:)

The iOS SDK compiler rejected this binding: cannot find 'defaultTextFontSize' in scope

protocol implementation EntityGestureRecognizer

synchronous protocol result requires an active JS-thread call; delegate invocations can escape it