NSCurrentLocaleDidChangeNotification on iPhone OS

While NSCurrentLocaleDidChangeNotification great for Mac OS X, I don’t see how you can get it on iPhone OS. To change the locale, you must exit the running application, and then change it in the settings β†’ General β†’ International β†’ Region format. At this point, your application is not working, and how can it receive a notification?

At first, I thought this notification was left from the Mac OS X documentation, but then I found it in the Apple Push Notification Service Programming Guide :

The application can send its provider - the preferred language, the user changes something in the current language. To do this, you can listen to the notification with the name NSCurrentLocaleDidChangeNotification and in the notification processing method, get a code identifying the preferred language and send it to your provider.

So how do you call this notification on iPhone OS?

+4
source share
1 answer

Until you do this, since you cannot run any applications while changing the locale. In the future, you can (hint hint *).

Note that you can query the current language via +[NSLocale currentLocale] , as usual.

* I do not belong to insider information.

+4
source

Source: https://habr.com/ru/post/1304998/


All Articles