Global Variable

HKUserPreferencesDidChangeNotification

Notifies observers whenever the user changes his or her preferred units.

Declaration

NSString *const HKUserPreferencesDidChangeNotification;

Discussion

The preferred units are the units that the user prefers for a given measurement type. By default, the preferred units are based on the device’s current locale. For example, in the US, the preferred units for the HKQuantityTypeIdentifierBodyMass identifier are pounds. Other regions may use kilograms or stones. However, users can change their preferred units in the Health app at any time.

Each HKHealthStore object posts its own HKUserPreferencesDidChangeNotification notification. To avoid receiving duplicate notifications, always pass a health store instance to the notification center when adding observers.

See Also

Accessing the Preferred Units

- preferredUnitsForQuantityTypes:completion:

Returns the user’s preferred units for the given quantity types.