One Logo Pool Ball
SensorKit · IOS API REFERENCE

SRFetchResponse

struct · iOS 27.0+ · SDK 27.1

struct SRFetchResponse<Sample>

A generic container that holds sensor data samples retrieved from SensorKit data streams. `SRFetchResponse` is a type-safe container that wraps individual sensor data samples. It serves as the primary data delivery mechanism for sensor information retrieved through `SRReader.fetch(_:)` operations. ## Usage Example ```swift let request = SRFetchRequest() for try await response in reader.fetch(request) { // Extract the sensor sample switch response.sample { case .success(let sample): print("Sample data: \(sample)") case .failure(let error): print("Failed to decode sample: \(error)") } // Get the timestamp when data was recorded let timestamp = response.timestamp() print("Recorded at: \(Date(timeIntervalSinceReferenceDate: timestamp))") } ```

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

No declarations were skipped in this snapshot.

All SensorKit types →