An HKSourceRevision object represents both the app and the version of the app that saved an object into the HealthKit store. This class acts as a wrapper for the HKSource class, adding version information to the source.


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 Notes

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


Creating Source Revision Objects

init(source: HKSource, version: String?)

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

Accessing Source and Version Information

var source: HKSource

The source for a sample.

var version: String?

A string identifying a particular version of the source.


Inherits From