<!--
{
  "availability" : [
    "iOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioAccessoryKit",
  "identifier" : "/documentation/AudioAccessoryKit/AccessorySensorUpdates",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "AudioAccessoryKit"
    ],
    "preciseIdentifier" : "s:17AudioAccessoryKit0B13SensorUpdatesV"
  },
  "title" : "AccessorySensorUpdates"
}
-->

# AccessorySensorUpdates

Subscribes to a stream of raw sensor data packets from a connected accessory.

```
struct AccessorySensorUpdates
```

## Overview

An Audio Rendering Extension launched by AudioToolbox uses this type to receive
sensor data from a 3P accessory that has registered `.headTracking` via
`AccessoryControlDevice`. Data is brokered through `audioaccessoryd` over XPC.

No XPC resources are acquired until iteration begins. Cancel the owning `Task`
to stop receiving updates and release the connection.

## Usage

```swift
guard AccessorySensorUpdates.isSupported else { return }
let updates = AccessorySensorUpdates(for: accessoryIdentifier)
sensorTask = Task { [weak self] in
    do {
        for try await data in updates {
            self?.processSensorData(data)
        }
    } catch AccessorySensorUpdates.StreamError.connectionLost {
        // Terminal; stream is over
    }
}
```

## Topics

### Initializers

[`init(for: String)`](/documentation/AudioAccessoryKit/AccessorySensorUpdates/init(for:))

Creates a sensor update sequence for the specified accessory.

### Type Properties

[`static var isSupported: Bool`](/documentation/AudioAccessoryKit/AccessorySensorUpdates/isSupported)

Returns `true` when the running OS version supports `AccessorySensorUpdates`.

### Enumerations

[`enum StreamError`](/documentation/AudioAccessoryKit/AccessorySensorUpdates/StreamError)

## Relationships

### Conforms To

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

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

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

---

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)