<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SensorKit",
  "identifier" : "/documentation/SensorKit/SRDeletionRecord",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "SensorKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SRDeletionRecord"
  },
  "title" : "SRDeletionRecord"
}
-->

# SRDeletionRecord

An object that describes the reason the framework deletes samples.

```
class SRDeletionRecord
```

## Overview

When there are gaps in a recorded sensor’s data, deletion records account for the occasions when the framework deliberately removes the records. A deletion record specifies the time range when records are unavailable (see [`startTime`](/documentation/SensorKit/SRDeletionRecord/startTime) and [`endTime`](/documentation/SensorKit/SRDeletionRecord/endTime)), and the [`reason`](/documentation/SensorKit/SRDeletionRecord/reason) for removal.

To access deletion records for a particular sensor, create a new reader by applying the `sr_sensorForDeletionRecordsFromSensor()` extension of <doc://com.apple.documentation/documentation/Foundation/NSString> to the source sensor.

```swift
let deletionRecordsReader = SRSensorReader(sensor: ambientLightSensor.rawValue.sr_sensorForDeletionRecordsFromSensor())
deletionRecordsReader.delegate = myAmbientLightDeletionRecordsDelegate
```

## Topics

### Accessing the Deletion Reason

[`var reason: SRDeletionReason`](/documentation/SensorKit/SRDeletionRecord/reason)

The reason the framework deletes samples.

[`enum SRDeletionReason`](/documentation/SensorKit/SRDeletionReason)

Reasons that the framework deletes samples.

### Accessing the Deletion Time

[`var startTime: SRAbsoluteTime`](/documentation/SensorKit/SRDeletionRecord/startTime)

The time the framework begins deleting samples.

[`var endTime: SRAbsoluteTime`](/documentation/SensorKit/SRDeletionRecord/endTime)

The time the framework finishes deleting samples.

## Relationships

### Conforms To

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

[`NSCoding`](/documentation/Foundation/NSCoding)

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

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

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

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

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

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

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

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

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)