Type Method

moleUnitWithMetricPrefix:molarMass:

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

Declaration

+ (instancetype)moleUnitWithMetricPrefix:(HKMetricPrefix)prefix molarMass:(double)gramsPerMole;

Parameters

prefix

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

gramsPerMole

The molar mass, in grams per mole, of the item to be weighed.

Return Value

A HealthKit unit for measuring mass in moles.

Discussion

This method allows the creation of units to measure mass in moles with a given metric prefix and molecular mass. For example, to measure blood glucose in millimoles, you need to use both the correct prefix (milli-) and the HKUnitMolarMassBloodGlucose constant.).

HKUnit *millimolesOfBloodGlucose =
[HKUnit moleUnitWithMetricPrefix:HKMetricPrefixMilli molarMass:HKUnitMolarMassBloodGlucose];

See Also

Constructing Mass Units

+ gramUnit

Returns a HealthKit unit for measuring mass in grams.

+ gramUnitWithMetricPrefix:

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

+ 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.

HKUnitMolarMassBloodGlucose

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