AccessoryAnchor
NewvisionOSextension AccessoryAnchor : ARKitCoordinateSpaceProvidingDeclaration
extension AccessoryAnchor : ARKitCoordinateSpaceProviding {
}What's New / Spatial, 3D & RealityKit
ARKit provides device and world tracking through anchors, sessions, and coordinate spaces that map real-world geometry into a 3D scene. On visionOS it supports hand, device, and scene reconstruction tracking. On iOS it drives camera-based tracking.
35 new APIs, 2 deprecations, nothing removed. New types include ARKitCoordinateSpace (with nested AncestorCoordinateSpace and Correction), the ARKitCoordinateSpaceProviding protocol, FieldOfView, FieldOfViewAnchor, DeviceFitStatus, and VisualFidelityData. An accessory-tracking path adds AccessoryAnchor, updateAccessories, and Error.Code.updateAccessoriesFailed. The two deprecations are TrackingConfiguration.stationaryObjectTrackingRate and TrackingConfiguration.movingObjectTrackingRate.
AccessoryAnchorextension AccessoryAnchor : ARKitCoordinateSpaceProvidingextension AccessoryAnchor : ARKitCoordinateSpaceProviding {
}ARKitCoordinateSpacepublic struct ARKitCoordinateSpace : CoordinateSpace3DFloatAn object which represents an ARKit coordinate space.
public struct ARKitCoordinateSpace : CoordinateSpace3DFloat {
/// The parent space of this ARKit coordinate space.
public var ancestorSpace: WorldReferenceCoordinateSpace? { get }
/// Get the transformation to ancestor space from this ARKit coordinate space.
///
/// - Returns: The transformation to ancestor space from this ARKit coordinate space.
public func ancestorFromSpaceTransformFloat() -> ProjectiveTransform3DFloat
/// A correction type to apply on coordinate spaces returned from ARKit APIs.
@frozen public enum Correction : CustomStringConvertible {
/// Coordinate spaces are unaltered and represent actual locations.
case none
/// Coordinate spaces are corrected to render over physical objects in passthrough displays.
case rendered
/// Textual description of this correction type.
public var description: String { get }
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (a: ARKitCoordinateSpace.Correction, b: ARKitCoordinateSpace.Correction) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}
@available(macOS 27.0, visionOS 26.0, *)
public typealias AncestorCoordinateSpace = WorldReferenceCoordinateSpace
}ARKitCoordinateSpace.Correctionextension ARKitCoordinateSpace.Correction : Equatableextension ARKitCoordinateSpace.Correction : Equatable {
}ARKitCoordinateSpace.Correctionextension ARKitCoordinateSpace.Correction : Hashableextension ARKitCoordinateSpace.Correction : Hashable {
}ARKitCoordinateSpace.Correctionextension ARKitCoordinateSpace.Correction : Sendableextension ARKitCoordinateSpace.Correction : Sendable {
}ARKitCoordinateSpace.Correctionextension ARKitCoordinateSpace.Correction : BitwiseCopyableextension ARKitCoordinateSpace.Correction : BitwiseCopyable {
}ARKitCoordinateSpaceProvidingpublic protocol ARKitCoordinateSpaceProvidingA type that provides an ARKit coordinate space with an optional correction applied.
public protocol ARKitCoordinateSpaceProviding {
/// The coordinate space of this object.
/// - Parameters:
/// - correction: Correction type to apply.
/// - Returns: The coordinate space.
func coordinateSpace(correction: ARKitCoordinateSpace.Correction) -> ARKitCoordinateSpace
}ARKitSession.Events.Iteratorextension ARKitSession.Events.Iterator : @unchecked Sendableextension ARKitSession.Events.Iterator : @unchecked Sendable {
}BarcodeAnchorextension BarcodeAnchor : ARKitCoordinateSpaceProvidingextension BarcodeAnchor : ARKitCoordinateSpaceProviding {
/// The anchor's coordinate space.
/// - Parameters:
/// - correction: Correction type to apply.
/// - Returns: The anchor's coordinate space.
public func coordinateSpace(correction: ARKitCoordinateSpace.Correction) -> ARKitCoordinateSpace
}CameraRegionAnchorextension CameraRegionAnchor : ARKitCoordinateSpaceProvidingextension CameraRegionAnchor : ARKitCoordinateSpaceProviding {
/// The anchor's coordinate space.
/// - Parameters:
/// - correction: Correction type to apply.
/// - Returns: The anchor's coordinate space.
public func coordinateSpace(correction: ARKitCoordinateSpace.Correction) -> ARKitCoordinateSpace
}DeviceAnchorextension DeviceAnchor : ARKitCoordinateSpaceProvidingextension DeviceAnchor : ARKitCoordinateSpaceProviding {
/// The anchor's coordinate space.
/// - Parameters:
/// - correction: Correction type to apply.
/// - Returns: The anchor's coordinate space.
public func coordinateSpace(correction: ARKitCoordinateSpace.Correction) -> ARKitCoordinateSpace
}DeviceFitStatuspublic enum DeviceFitStatus : CustomStringConvertible, SendableDevice fit validation status indicating the user's eye position relative to the optimal device fit range.
public enum DeviceFitStatus : CustomStringConvertible, Sendable {
/// User's eyes are properly positioned within the optimal device fit range.
case valid
/// User's eyes are positioned above the optimal device fit range.
case eyesAbove
/// User's eyes are positioned below the optimal device fit range.
case eyesBelow
/// User's eyes are positioned to the left of the optimal device fit range.
case eyesLeft
/// User's eyes are positioned to the right of the optimal device fit range.
case eyesRight
/// A textual representation of the device fit status.
public var description: String { get }
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (a: DeviceFitStatus, b: DeviceFitStatus) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}DeviceFitStatusextension DeviceFitStatus : Equatableextension DeviceFitStatus : Equatable {
}DeviceFitStatusextension DeviceFitStatus : Hashableextension DeviceFitStatus : Hashable {
}EnvironmentProbeAnchorextension EnvironmentProbeAnchor : ARKitCoordinateSpaceProvidingextension EnvironmentProbeAnchor : ARKitCoordinateSpaceProviding {
/// The anchor's coordinate space.
/// - Parameters:
/// - correction: Correction type to apply.
/// - Returns: The anchor's coordinate space.
public func coordinateSpace(correction: ARKitCoordinateSpace.Correction) -> ARKitCoordinateSpace
}FieldOfViewAnchorpublic struct FieldOfViewAnchor : Anchor, ARKitCoordinateSpaceProviding, @unchecked Sendable, EquatableAn anchor representing a set of field of view (FoV) boundary polygon points in immersive space.
This anchor provides polygon points that define preset FoV boundaries, allowing applications to visualize these FoVs in the immersive space.
public struct FieldOfViewAnchor : Anchor, ARKitCoordinateSpaceProviding, @unchecked Sendable, Equatable {
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: FieldOfViewAnchor, rhs: FieldOfViewAnchor) -> Bool
/// A textual representation of this anchor.
public var description: String { get }
/// Left eye polygon boundary points defining the preset field of view.
///
/// Each point represents a vertex of the polygon boundary, ordered to form a continuous
/// polygon. Points are expressed in the anchor's coordinate frame.
public var leftPolygonPoints: [simd_float4] { get }
/// Right eye polygon boundary points defining the preset field of view.
///
/// Each point represents a vertex of the polygon boundary, ordered to form a continuous
/// polygon. Points are expressed in the anchor's coordinate frame.
public var rightPolygonPoints: [simd_float4] { get }
/// The unique identifier of this anchor.
public var id: UUID { get }
/// The timestamp of this anchor.
public var timestamp: TimeInterval { get }
/// The transform from the anchor to the origin coordinate system.
public var originFromAnchorTransform: simd_float4x4 { get }
/// The anchor's coordinate space.
/// - Parameters:
/// - correction: Correction type to apply.
/// - Returns: The anchor's coordinate space.
public func coordinateSpace(correction: ARKitCoordinateSpace.Correction) -> ARKitCoordinateSpace
/// A type representing the stable identity of the entity associated with
/// an instance.
@available(visionOS 27.0, *)
@available(macOS, unavailable)
public typealias ID = UUID
}HandAnchorextension HandAnchor : ARKitCoordinateSpaceProvidingextension HandAnchor : ARKitCoordinateSpaceProviding {
/// The anchor's coordinate space.
/// - Parameters:
/// - correction: Correction type to apply.
/// - Returns: The anchor's coordinate space.
public func coordinateSpace(correction: ARKitCoordinateSpace.Correction) -> ARKitCoordinateSpace
}HandSkeleton.Jointextension HandSkeleton.Joint : ARKitCoordinateSpaceProvidingextension HandSkeleton.Joint : ARKitCoordinateSpaceProviding {
/// The joint's coordinate space.
///
/// - Parameters:
/// - correction: Correction type to apply.
///
/// - Returns: The joint's coordinate space.
public func coordinateSpace(correction: ARKitCoordinateSpace.Correction) -> ARKitCoordinateSpace
}ImageAnchorextension ImageAnchor : ARKitCoordinateSpaceProvidingextension ImageAnchor : ARKitCoordinateSpaceProviding {
/// The anchor's coordinate space.
/// - Parameters:
/// - correction: Correction type to apply.
/// - Returns: The anchor's coordinate space.
public func coordinateSpace(correction: ARKitCoordinateSpace.Correction) -> ARKitCoordinateSpace
}MeshAnchorextension MeshAnchor : ARKitCoordinateSpaceProvidingextension MeshAnchor : ARKitCoordinateSpaceProviding {
/// The anchor's coordinate space.
/// - Parameters:
/// - correction: Correction type to apply.
/// - Returns: The anchor's coordinate space.
public func coordinateSpace(correction: ARKitCoordinateSpace.Correction) -> ARKitCoordinateSpace
}ObjectAnchorextension ObjectAnchor : ARKitCoordinateSpaceProvidingextension ObjectAnchor : ARKitCoordinateSpaceProviding {
/// The anchor's coordinate space.
/// - Parameters:
/// - correction: Correction type to apply.
/// - Returns: The anchor's coordinate space.
@available(visionOS 27.0, *)
@available(macOS, unavailable)
public func coordinateSpace(correction: ARKitCoordinateSpace.Correction) -> ARKitCoordinateSpace
}PlaneAnchorextension PlaneAnchor : ARKitCoordinateSpaceProvidingextension PlaneAnchor : ARKitCoordinateSpaceProviding {
/// The anchor's coordinate space.
/// - Parameters:
/// - correction: Correction type to apply.
/// - Returns: The anchor's coordinate space.
public func coordinateSpace(correction: ARKitCoordinateSpace.Correction) -> ARKitCoordinateSpace
}RoomAnchorextension RoomAnchor : ARKitCoordinateSpaceProvidingextension RoomAnchor : ARKitCoordinateSpaceProviding {
/// The anchor's coordinate space.
/// - Parameters:
/// - correction: Correction type to apply.
/// - Returns: The anchor's coordinate space.
public func coordinateSpace(correction: ARKitCoordinateSpace.Correction) -> ARKitCoordinateSpace
}updateAccessoriesfinal public func updateAccessories(_ accessories: [Accessory]) async throwsUpdates the accessories being tracked by a provider.
Updates are atomic: if any accessory fails to be added, the entire request fails and the provider continues tracking the original set of accessories.
Update requests are processed sequentially. If multiple requests are made while an update is in progress, only the most recent request is retained and will be processed next; intermediate requests are superseded and throw an error.
Parameters
accessoriesReturnsThrows: AccessoryTrackingProvider.Error if the update fails, including when one or more accessories cannot be added or the request is superseded by a more recent request.
VisualFidelityDatapublic struct VisualFidelityData : @unchecked Sendable, CustomStringConvertible, EquatableVisual fidelity data containing device fit and field of view verification.
public struct VisualFidelityData : @unchecked Sendable, CustomStringConvertible, Equatable {
/// The timestamp when this validation data was captured.
public var timestamp: TimeInterval { get }
/// The device fit validation status.
///
/// Indicates whether the user's eyes are properly positioned within the optimal device fit range,
/// or provides directional feedback if positioned outside.
///
/// Note: Returns `.valid` if the provider was created without requesting device fit updates.
public var deviceFitStatus: DeviceFitStatus { get }
/// Indicates whether the field of view (FoV) is valid.
///
/// Returns `true` if the expected FoV meets requirements.
/// Returns `false` if any portion of the FoV is invalid.
///
/// Note: Returns `true` if the provider was created without a field of view.
public var isFieldOfViewValid: Bool { get }
/// A textual representation of this visual fidelity data.
public var description: String { get }
/// Compares two visual fidelity data instances for equality.
public static func == (lhs: VisualFidelityData, rhs: VisualFidelityData) -> Bool
}VisualFidelityProviderextension VisualFidelityProviderextension VisualFidelityProvider {
/// A field of view (FoV) specification.
///
/// The preset FoVs are the recommended specification method for most applications.
/// They provide standardized FoV requirements.
@available(visionOS 27.0, *)
@available(macOS, unavailable)
public struct FieldOfView : Sendable, Hashable, CustomStringConvertible {
/// Preset field of view A.
///
/// To learn more about this preset you can visualize the `FieldOfViewAnchor`.
public static let presetA: VisualFidelityProvider.FieldOfView
/// Preset field of view B.
///
/// To learn more about this preset you can visualize the `FieldOfViewAnchor`.
public static let presetB: VisualFidelityProvider.FieldOfView
/// Preset field of view C.
///
/// To learn more about this preset you can visualize the `FieldOfViewAnchor`.
public static let presetC: VisualFidelityProvider.FieldOfView
/// Preset field of view D.
///
/// To learn more about this preset you can visualize the `FieldOfViewAnchor`.
public static let presetD: VisualFidelityProvider.FieldOfView
/// Creates a polygon-based field of view.
public static func polygon(points: [simd_float2]) -> VisualFidelityProvider.FieldOfView
/// Validates whether this field of view specification is valid.
public var isValid: Bool { get }
/// A textual representation of the field of view.
public var description: String { get }
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (a: VisualFidelityProvider.FieldOfView, b: VisualFidelityProvider.FieldOfView) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}
}WorldAnchorextension WorldAnchor : ARKitCoordinateSpaceProvidingextension WorldAnchor : ARKitCoordinateSpaceProviding {
/// The anchor's coordinate space.
/// - Parameters:
/// - correction: Correction type to apply.
/// - Returns: The anchor's coordinate space.
public func coordinateSpace(correction: ARKitCoordinateSpace.Correction) -> ARKitCoordinateSpace
}ARKitCoordinateSpace.AncestorCoordinateSpacepublic typealias AncestorCoordinateSpace = WorldReferenceCoordinateSpaceError.Code.updateAccessoriesFailedcase updateAccessoriesFailedUpdating accessories failed.
This error is returned when one or more accessories cannot be added or the request is superseded by a more recent request.
FieldOfViewAnchor.IDpublic typealias ID = UUIDA type representing the stable identity of the entity associated with an instance.
ObjectAnchor.coordinateSpacepublic func coordinateSpace(correction: ARKitCoordinateSpace.Correction) -> ARKitCoordinateSpaceThe anchor's coordinate space.
Parameters
correctionReturnsThe anchor's coordinate space.
ReferenceObject.Configurationpublic struct Configuration : CustomStringConvertible, Sendable, EquatableDefines a configuration for an individual reference object.
public struct Configuration : CustomStringConvertible, Sendable, Equatable {
/// Returns a Boolean value indicating whether two configurations are equal.
///
/// - Parameters:
/// - lhs: The left-hand side configuration to compare.
/// - rhs: The right-hand side configuration to compare.
///
/// - Returns: `true` if the two configurations are equal; otherwise, `false`.
public static func == (lhs: ReferenceObject.Configuration, rhs: ReferenceObject.Configuration) -> Bool
/// Whether to enable high frame-rate tracking for this object.
public var highFrameRateTrackingEnabled: Bool
/// A textual representation of this reference object configuration.
public var description: String { get }
/// Create a reference object configuration.
public init()
}ReferenceObject.initpublic init(from url: URL, configuration: ReferenceObject.Configuration) async throwsInitializes a reference object from a URL, with reference object configuration.
Parameters
urlconfigurationReturnsThrows: ObjectTrackingProvider.Error
ReferenceObject.initpublic init(named: String, from bundle: Bundle? = nil, configuration: ReferenceObject.Configuration) async throwsInitializes a reference object from a bundle, with reference object configuration.
Parameters
namedbundleconfigurationReturnsThrows: ObjectTrackingProvider.Error
VisualFidelityProvider.FieldOfViewpublic struct FieldOfView : Sendable, Hashable, CustomStringConvertibleA field of view (FoV) specification.
The preset FoVs are the recommended specification method for most applications. They provide standardized FoV requirements.
public struct FieldOfView : Sendable, Hashable, CustomStringConvertible {
/// Preset field of view A.
///
/// To learn more about this preset you can visualize the `FieldOfViewAnchor`.
public static let presetA: VisualFidelityProvider.FieldOfView
/// Preset field of view B.
///
/// To learn more about this preset you can visualize the `FieldOfViewAnchor`.
public static let presetB: VisualFidelityProvider.FieldOfView
/// Preset field of view C.
///
/// To learn more about this preset you can visualize the `FieldOfViewAnchor`.
public static let presetC: VisualFidelityProvider.FieldOfView
/// Preset field of view D.
///
/// To learn more about this preset you can visualize the `FieldOfViewAnchor`.
public static let presetD: VisualFidelityProvider.FieldOfView
/// Creates a polygon-based field of view.
public static func polygon(points: [simd_float2]) -> VisualFidelityProvider.FieldOfView
/// Validates whether this field of view specification is valid.
public var isValid: Bool { get }
/// A textual representation of the field of view.
public var description: String { get }
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (a: VisualFidelityProvider.FieldOfView, b: VisualFidelityProvider.FieldOfView) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}TrackingConfiguration.movingObjectTrackingRatepublic var movingObjectTrackingRate: FloatThe frequency at which object tracking runs for moving objects, in Hz. Clamped between 0 and 30 Hz (default 5).
TrackingConfiguration.stationaryObjectTrackingRatepublic var stationaryObjectTrackingRate: FloatThe frequency at which object tracking runs for stationary objects, in Hz. Clamped between 0 and 30 Hz (default 5).
No APIs match your filter.