HKUnit formatting API needs update

Originator:an00na
Number:rdar://45196598 Date Originated:October 11 2018, 12:12 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:12
Classification:Suggestion Reproducible:
 
Area:
HealthKit

Currently only energy, length and mass HKUnit can be formatted via EnergyFormatter, LengthFormatter and MassFormatter. But all the 3 formatters' documents say we should use MeasurementFormatter instead. So HKUnit should work with MeasurementFormatter directly. Another benefit of that is we can support many more units.

Also, I noticed that in the Defining and Converting Units and Quantities article(https://developer.apple.com/documentation/healthkit/samples/units_and_quantities/defining_and_converting_units_and_quantities) that "You can use MeasurementFormatter to localize quantities such as length, mass, and energy. " But I couldn't find how. I'm not sure if I missed some API or the doc is incorrect.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!