massFormatterUnit(from:)
Converts a HealthKit unit object into a corresponding mass formatter enumeration value.
Declaration
class func massFormatterUnit(from unit: HKUnit) -> MassFormatter.UnitParameters
- unit:
A valid HealthKit unit object. If the unit is not a mass-type unit, this method throws an exception (Invalidargumentexception).
Return Value
A mass formatter unit value. For a list of possible mass formatter unit values, see MassFormatter.Unit.