<!--
{
  "availability" : [
    "iOS: 13.0.0 - 27.0.0",
    "iPadOS: 13.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SensorKit",
  "identifier" : "/documentation/SensorKit/SRSensorReaderDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "SensorKit"
    ],
    "preciseIdentifier" : "c:objc(pl)SRSensorReaderDelegate"
  },
  "title" : "SRSensorReaderDelegate"
}
-->

# SRSensorReaderDelegate

A set of callbacks the framework invokes to notify the app of sensor-related events.

```
protocol SRSensorReaderDelegate : NSObjectProtocol
```

## Overview

To access sensor data, assign an object as the delegate and implement its callbacks.

## Topics

### Checking Authorization Status

[`func sensorReader(SRSensorReader, didChange: SRAuthorizationStatus)`](/documentation/SensorKit/SRSensorReaderDelegate/sensorReader(_:didChange:))

Notifies the delegate of the reader’s new authorization status.

### Fetching Devices

[`func sensorReader(SRSensorReader, didFetch: [SRDevice])`](/documentation/SensorKit/SRSensorReaderDelegate/sensorReader(_:didFetch:))

Provides the delegate with one or more devices.

[`func sensorReader(SRSensorReader, fetchDevicesDidFailWithError: any Error)`](/documentation/SensorKit/SRSensorReaderDelegate/sensorReader(_:fetchDevicesDidFailWithError:))

Provides the delegate a reason when the reader fails to fetch devices.

[`class SRDevice`](/documentation/SensorKit/SRDevice)

A representation of a device that provides sample data.

### Recording Data

[`func sensorReaderWillStartRecording(SRSensorReader)`](/documentation/SensorKit/SRSensorReaderDelegate/sensorReaderWillStartRecording(_:))

Notifies the delegate when a reader starts recording.

[`func sensorReader(SRSensorReader, startRecordingFailedWithError: any Error)`](/documentation/SensorKit/SRSensorReaderDelegate/sensorReader(_:startRecordingFailedWithError:))

Provides the delegate with a reason when the reader fails to record.

[`func sensorReaderDidStopRecording(SRSensorReader)`](/documentation/SensorKit/SRSensorReaderDelegate/sensorReaderDidStopRecording(_:))

Notifies the delegate when a reader stops recording.

[`func sensorReader(SRSensorReader, stopRecordingFailedWithError: any Error)`](/documentation/SensorKit/SRSensorReaderDelegate/sensorReader(_:stopRecordingFailedWithError:))

Provides the delegate with a reason when the reader fails to stop recording.

### Reading Recorded Data

[`func sensorReader(SRSensorReader, fetching: SRFetchRequest, didFetchResult: SRFetchResult<AnyObject>) -> Bool`](/documentation/SensorKit/SRSensorReaderDelegate/sensorReader(_:fetching:didFetchResult:))

Provides the delegate with a fetch result.

[`func sensorReader(SRSensorReader, didCompleteFetch: SRFetchRequest)`](/documentation/SensorKit/SRSensorReaderDelegate/sensorReader(_:didCompleteFetch:))

Provides the delegate with a completed fetch request.

[`func sensorReader(SRSensorReader, fetching: SRFetchRequest, failedWithError: any Error)`](/documentation/SensorKit/SRSensorReaderDelegate/sensorReader(_:fetching:failedWithError:))

Provides the delegate with a fetch failure reason.

### Interpreting Errors

[`let SRErrorDomain: String`](/documentation/SensorKit/SRErrorDomain)

An error domain that’s unique to the framework.

[`struct SRError`](/documentation/SensorKit/SRError)

An error that SensorKit reports.

[`enum Code`](/documentation/SensorKit/SRError/Code)

The kinds of problems that stop a recording or a fetch.

## Relationships

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

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)