Initializer

init(from:)

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

Declaration

convenience init(from lengthFormatterUnit: LengthFormatter.Unit)

Parameters

lengthFormatterUnit

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

Return Value

A HealthKit unit object, or nil if the unit parameter is not a valid length formatter unit value.

See Also

Working with Formatter Units

class func energyFormatterUnit(from: HKUnit) -> EnergyFormatter.Unit

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

init(from: EnergyFormatter.Unit)

Converts an energy formatter enumeration value into a corresponding HealthKit unit object.

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

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

class func massFormatterUnit(from: HKUnit) -> MassFormatter.Unit

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

init(from: MassFormatter.Unit)

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