<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/AnchoringComponent/AccessoryAnchoringSource",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation18AnchoringComponentV09AccessoryC6SourceV"
  },
  "title" : "AnchoringComponent.AccessoryAnchoringSource"
}
-->

# AnchoringComponent.AccessoryAnchoringSource

Defines the source of accessory anchoring target based on how it is created.

```
struct AccessoryAnchoringSource
```

## Topics

### Creating an anchoring source

[`init(type: AnchoringComponent.AccessoryAnchoringSource.AccessoryType, location: String?)`](/documentation/RealityKit/AnchoringComponent/AccessoryAnchoringSource/init(type:location:))

Creates an accessory anchoring source for a deferred accessory type.

### Specifying the accessory type

[`struct AccessoryType`](/documentation/RealityKit/AnchoringComponent/AccessoryAnchoringSource/AccessoryType)

Describes the type of accessory to track.

### Initializers

[`init(accessory: Accessory) throws`](/documentation/RealityKit/AnchoringComponent/AccessoryAnchoringSource/init(accessory:))

[`init(device: any GCDevice) async throws`](/documentation/RealityKit/AnchoringComponent/AccessoryAnchoringSource/init(device:))

Creates the accessory anchoring source by the GCDevice asynchronously
Returns an AccessoryAnchoringSource if the GCDevice supports spatial tracking, throwing an error otherwise

### Instance Properties

[`var accessoryLocations: [AnchoringComponent.AccessoryLocation]`](/documentation/RealityKit/AnchoringComponent/AccessoryAnchoringSource/accessoryLocations)

The list of anchor-able locations for this accessory.

[`var underlyingAccessory: Accessory?`](/documentation/RealityKit/AnchoringComponent/AccessoryAnchoringSource/underlyingAccessory)

A reference to the root accessory object.

### Instance Methods

[`func locationName(named: String) -> AnchoringComponent.AccessoryLocation?`](/documentation/RealityKit/AnchoringComponent/AccessoryAnchoringSource/locationName(named:))

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)