Class

HKSourceRevision

An object indicating the source of a HealthKit sample.

Declaration

@interface HKSourceRevision : NSObject

Overview

The HKSourceRevision class acts as a wrapper for the HKSource class, adding information about the source's version, operating system, and product type.

Source revision objects are immutable: you set the source revision’s properties when you create the object, and they cannot change.

When an HKObject instance is created, its sourceRevision property is set to nil. When the object is saved to the HealthKit store, HealthKit assigns a new source revision to the object’s sourceRevision property. The source revision can be accessed only on objects retrieved from the HealthKit store.

Subclassing Source Revisions

Like many HealthKit classes, the HKSourceRevision class is not extensible and should not be subclassed.

Topics

Creating Source Revision Objects

- initWithSource:version:

Initializes a new source revision object with the provided source and version information.

- initWithSource:version:productType:operatingSystemVersion:

Initializes a new source revision object with the provided source, version, product type, and operating system.

Accessing Source and Version Information

source

The source for a sample.

version

A string that identifies a particular version of the source.

operatingSystemVersion

A string that identifies the operating system used to save a sample.

productType

A string that identifies the device used to save a sample.

Relationships

Inherits From

See Also

Sources and Devices

HKSource

An object indicating the app or device that created a HealthKit sample

HKDevice

A device that generates data for HealthKit.

HKSourceQuery

A query that returns a list of sources (apps and devices) that have saved matching queries to the HealthKit store.