Type Method

gramUnitWithMetricPrefix:

Returns a HealthKit unit for measuring mass, using gram units with the provided prefix.

Declaration

+ (instancetype)gramUnitWithMetricPrefix:(HKMetricPrefix)prefix;

Parameters

prefix

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

Return Value

A HealthKit unit for measuring mass based on grams and the given prefix.

Discussion

This method is used to create prefixed versions of grams, typically kilogram units, as shown below.

HKUnit *kg = [HKUnit gramUnitWithMetricPrefix:HKMetricPrefixKilo];

See Also

Constructing Mass Units

+ gramUnit

Returns a HealthKit unit for measuring mass in grams.

+ ounceUnit

Returns a HealthKit unit for measuring mass in ounces.

+ poundUnit

Returns a HealthKit unit for measuring mass in pounds.

+ stoneUnit

Returns a HealthKit unit for measuring mass in stones.

+ moleUnitWithMolarMass:

Returns a HealthKit unit for measuring mass in moles for a given molar mass.

+ moleUnitWithMetricPrefix:molarMass:

Returns a HealthKit unit for measuring mass in moles, with the given prefix and molar mass.

HKUnitMolarMassBloodGlucose

The molecular mass of blood glucose, typically used to create mole units for blood glucose.