HealthKit is missing a way of getting localized, human readable strings of object types

Originator:mert
Number:rdar://21638119 Date Originated:01-Jul-2015 01:05 PM
Status:Open Resolved:
Product:iOS SDK Product Version:9.0
Classification:Feature (New) Reproducible:Always
 
Summary:
HealthKit is missing a way of getting localized, human readable strings of object types.

HKObjectType are distinguished from each other by an identifier property. This identifier property can be one of many constants in HKTypeIdentifiers.h. There are cases where these types have to be represented in the UI. Right now, I am maintaining a huge dictionary of type identifiers to readable strings. (which I am having a hard time localizing since they can get very domain specific)

Ideally, making -[HKObjectType hk_localizedName] public would solve this problem by giving developers a way of representing HKObjectTypes in UI.

Steps to Reproduce:
Create a HKObjectType using one of the type identifiers from HKTypeIdentifiers.h.
Try to get a readable representation of this type.
	(i.e. HKQuantityTypeIdentifierDietaryVitaminB12 -> Vitamin B12)

Expected Results:
A localized, readable representation of the HKObjectType.

Actual Results:
No localized, readable representation of the HKObjectType.

Regression:
Occurs on all versions of HealthKit shipped to date—including the latest build of iOS 9.

Notes:

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!