Contents

meterUnit(with:)

Returns a HealthKit unit for measuring length, using meter units with the provided prefix.

Declaration

class func meterUnit(with prefix: HKMetricPrefix) -> Self

Parameters

  • prefix:

    A valid metric prefix value. For the complete list of prefix values, see Hkmetricprefix.

Return Value

A HealthKit unit for measuring length based on meters and the provided prefix.

Discussion

This method is used to create prefixed versions of meters. Common uses include creating kilometer and centimeter units, as shown below.

See Also

Constructing length units