How to create a time zone selection, for example, the Settings app in iOS

I am trying to get a selection table view, similar to that in the Settings application, for selecting a time zone in an iOS application where time zones with the beautifully formatted name "City and Country" are displayed.

From the documentation, the + (NSArray *)knownTimeZoneNames returns all the “timezone identifiers” in alphabetical order but not in “temporary” order, and these names are pretty ugly to read, for example, America/New_York . All other methods in NSTimeZone return localized names, such as "Central Standard Time" for Central Time. However, these names mean nothing to most users, since they are used for discussion from the point of view of "cities", and not from the point of view of "time zones" (especially in Europe).

Is there a way to achieve the same view as in the Settings application using my own NSTimeZone methods, or should I create a database of time zones and cities myself?

Settings App time zones example

+6
source share

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


All Articles