---
title: "init(from:)"
framework: healthkit
role: symbol
role_heading: Initializer
path: "healthkit/hkunit/init(from:)-55e1u"
---

# init(from:)

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

## Declaration

```swift
convenience init(from lengthFormatterUnit: LengthFormatter.Unit)
```

## Parameters

- `lengthFormatterUnit`: A valid length formatter unit value. For a list of possible length formatter unit values, see doc://com.apple.documentation/documentation/Foundation/LengthFormatter/Unit.

## Return Value

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

- [energyFormatterUnit(from:)](healthkit/hkunit/energyformatterunit(from:).md)
- [init(from:)](healthkit/hkunit/init(from:)-1j1pq.md)
- [lengthFormatterUnit(from:)](healthkit/hkunit/lengthformatterunit(from:).md)
- [massFormatterUnit(from:)](healthkit/hkunit/massformatterunit(from:).md)
- [init(from:)](healthkit/hkunit/init(from:)-7h2li.md)
