The HKDeletedObject class is used to represent samples that have been deleted from the HealthKit store.


You use HKAnchoredObjectQuery queries to generate a list of recently deleted objects. Create the query using the init(type:predicate:anchor:limit:resultsHandler:) method. When the result handler is called, it’s deletedObject parameter contains an array of HKDeletedObject instances that match the query.

However, deleted objects are temporary. The system eventually removes them from the store. Because users may run your app infrequently, if you want to guarantee that you receive notifications about all the deleted objects, use HKObserverQuery queries set for background delivery. In the observer query’s update handler, perform the anchored object query to determine which objects were deleted.


Identifying Deleted Objects

var uuid: UUID

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


Inherits From