Converts a HealthKit unit object into a corresponding length formatter enumeration value.
SDKs
- iOS 8.0+
- Mac Catalyst 13.0+
- watchOS 2.0+
Framework
- Health
Kit
Declaration
+ (NSLength Formatter Unit)lengthFormatterUnitFromUnit:(HKUnit *)unit;
Parameters
unit
A valid HealthKit unit object. If the unit is not a length unit, this method throws an exception (
NSInvalid
).Argument Exception
Return Value
A length formatter unit value. For a list of possible length formatter unit values see NSLength
.