<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKDeletedObject",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKDeletedObject"
  },
  "title" : "HKDeletedObject"
}
-->

# HKDeletedObject

An object that represents a sample that has been deleted from the HealthKit store.

```
class HKDeletedObject
```

## Overview

Use [`HKAnchoredObjectQuery`](/documentation/HealthKit/HKAnchoredObjectQuery) queries to generate a list of recently deleted objects. Create a query using the [`init(type:predicate:anchor:limit:resultsHandler:)`](/documentation/HealthKit/HKAnchoredObjectQuery/init(type:predicate:anchor:limit:resultsHandler:))method. When the system calls the result handler, it passes the `deletedObject` parameter an array of [`HKDeletedObject`](/documentation/HealthKit/HKDeletedObject) instances matching the query.

Deleted objects are temporary; the system may remove them from the HealthKit store at any time to free up space. To guarantee that you receive notifications for all deleted objects, create an [`HKObserverQuery`](/documentation/HealthKit/HKObserverQuery) and register it for background delivery. The system then wakes your app and calls the observer query’s update handler whenever the matching objects change—including deletions. However, the query does not provide a list of deleted objects. To determine which objects were deleted, use the observer query’s update handler to create an anchored object query for the newly deleted objects.

## Topics

### Identifying Deleted Objects

[`UUID`](/documentation/HealthKit/HKDeletedObject/uuid)

The universally unique identifier (UUID) for the HealthKit object that was deleted from the store.

[`metadata`](/documentation/HealthKit/HKDeletedObject/metadata)

The metadata associated with the deleted object.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

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

### 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)