---
title: "headTrackingStateDidChange(isActive:)"
framework: AudioAccessoryKit
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+]
path: "audioaccessorykit/audioaccessoryheadtracking/handler/headtrackingstatedidchange(isactive:)"
---

# headTrackingStateDidChange(isActive:)

Called when the user-facing Head Tracking state for this accessory changes (e.g. via Settings or Control Center).

## Declaration

```swift
func headTrackingStateDidChange(isActive: Bool)
```

## Parameters

- `isActive`: true when head tracking is enabled and the extension should stream IMU samples via Session.sendDataToAudioExtension(_:); false when head tracking is disabled and the extension should stop sampling.

## Discussion

Discussion Implementations should start or stop sampling the accessory’s IMU based on the new state.
