Contents

autoupdatingCurrent

A locale which tracks the user’s current preferences.

Declaration

class var autoupdatingCurrent: Locale { get }

Discussion

This value represents the locale currently used by the app, based on the following:

  • The current system locale.

  • Any app-specific locale choice made in the Settings app.

  • The availability of the preferred locale in the app. For example, if the person using an app has set their device to use a Spanish-language locale, but the app only supports English, this value returns an English locale.

Use this property when you want a locale that always reflects the latest configuration settings. When the person using the app changes settings, reading properties from a locale instance obtained from this property provides the latest values. If you need to rely on a locale that does not change, use the locale given by the current property instead.

Although the locale obtained here automatically follows the latest region settings, it provides no indication when the settings change. To receive notification of locale changes, add your object as an observer of currentLocaleDidChangeNotification.

See Also

Getting the User’s Locale