<!--
{
  "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/SRSensorReader/fetch(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SensorKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SRSensorReader(im)fetch:"
  },
  "title" : "fetch(_:)"
}
-->

# fetch(_:)

Fetches the samples that a fetch request specifies.

```
func fetch(_ request: SRFetchRequest)
```

## Parameters

`request`

An object that describes the device from which to retrieve samples, and samaple age of interest.

## Discussion

An app calls this function to access data for the caller’s sensor.

Upon success, the framework delivers results in the form of *samples* via the delegate’s [`sensorReader(_:fetching:didFetchResult:)`](/documentation/SensorKit/SRSensorReaderDelegate/sensorReader(_:fetching:didFetchResult:)) callback. The framework invokes the delegate multiple times if this function results in multiple samples.

The framework returns sensor data only for the argument fetch-object’s device, and that’s dated only within the argument fetch-object’s time window. Within that window, this function returns only the data that the framework recorded (see [`startRecording()`](/documentation/SensorKit/SRSensorReader/startRecording())), and that the framework hasn’t deleted (see [`SRDeletionRecord`](/documentation/SensorKit/SRDeletionRecord)).

---

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)