Class

HKDeletedObject

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

Overview

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.

Topics

Identifying Deleted Objects

var uuid: UUID

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

Instance Properties

Relationships

Inherits From

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software