Skip to content

What’s new in HealthKit

HealthKit is an essential framework that integrates first- and third-party health and fitness data to help people manage their personal health information. Learn about HealthKit’s latest updates, which provide read access to electrocardiograms on Apple Watch and log and track over a dozen new symptoms and their severity. We’ll also go through the latest mobility data types like walking speed and step length to help people monitor and understand their mobility over time.

Tracking Symptoms

30 Symptoms data types have been added to Health Kit this year, they are shown below.

Electrocardiogram (ECG)

ECG samples can now be read as an HKElectrocardiogram:

/// Represents a collection of voltage measurements.
class HKElectrocardiogram: HKSample {
  var classification: HKElectrocardiogram.Classification 
  var symptomsStatus: HKElectrocardiogram.SymptomsStatus 
  var averageHeartRate: HKQuantity? 
  var samplingFrequency: HKQuantity? 
  var number0fVoltageMeasurements: Int 
}

Here’s the description and documentation reference for such properties:

If you want individual measurements you have to run the HKElectrocardiogramQuery:

// Query 
class HKElectrocardiogramQuery: HKQuery {
  public enum Result {
    case measurement(HKElectrocardiogram.VoltageMeasurement)
    case error(Error)
    case done 
  }

  public convenience init(
    _ ecg: HKElectrocardiogram, 
    dataHandler: @escaping (HKElectrocardiogramQuery, HKElectrocardiogramQuery.Result) -> Void
  )
}

Mobility

New set of mobility types:

  • walking speed and step length

  • walking asymmetry and double support percentage

  • stair ascent and descent speed

  • six minute walk test

Missing anything? Corrections? Contributions are welcome!

Written By

mike011
mike011
3 notes contributed
zntfdr
zntfdr
332 notes contributed