---
title: HKSourceRevision
framework: healthkit
role: symbol
role_heading: Class
path: healthkit/hksourcerevision
---

# HKSourceRevision

An object indicating the source of a HealthKit sample.

## Declaration

```swift
class HKSourceRevision
```

## Mentioned in

About the HealthKit framework

## Overview

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 As with many HealthKit classes, don’t subclass the HKSourceRevision class.

## Topics

### Creating Source Revision Objects

- [init(source:version:)](healthkit/hksourcerevision/init(source:version:).md)
- [init(source:version:productType:operatingSystemVersion:)](healthkit/hksourcerevision/init(source:version:producttype:operatingsystemversion:).md)

### Accessing Source and Version Information

- [source](healthkit/hksourcerevision/source.md)
- [version](healthkit/hksourcerevision/version.md)
- [operatingSystemVersion](healthkit/hksourcerevision/operatingsystemversion.md)
- [productType](healthkit/hksourcerevision/producttype.md)

### Initializers

- [init(coder:)](healthkit/hksourcerevision/init(coder:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Sources and devices

- [HKSourceQueryDescriptor](healthkit/hksourcequerydescriptor.md)
- [HKSource](healthkit/hksource.md)
- [HKDevice](healthkit/hkdevice.md)
- [HKSourceQuery](healthkit/hksourcequery.md)
