Contents

lengthFormatterUnit(from:)

Converts a HealthKit unit object into a corresponding length formatter enumeration value.

Declaration

class func lengthFormatterUnit(from unit: HKUnit) -> LengthFormatter.Unit

Parameters

  • unit:

    A valid HealthKit unit object. If the unit is not a length unit, this method throws an exception (Invalidargumentexception).

Return Value

A length formatter unit value. For a list of possible length formatter unit values see LengthFormatter.Unit.

See Also

Working with formatter units