How to get list of available languages of Localizations of the project?

0 like 0 dislike
6 views
Good afternoon.
Created localization strings for the application to swift 4.
5ba6f20ddcf43062181948.png
Now I want to withdraw UIAlertControllerStyle.actionSheet with a list of these languages.
Please tell me how to do it, anywhere in the network can not find the implementation and manually create let availableLanguages = ["ru" : "Russian", "en" : "English"] is not convenient, if then more languages will be added.
by | 6 views

1 Answer

0 like 0 dislike
let availableLanguages = Bundle.main.localizations as [String]
a list of all available languages

let availableLanguages = Bundle.main.preferredLocalizations as [String]
the list of available languages with regard to the configuration of the system
by

Related questions

0 like 0 dislike
2 answers
asked May 10, 2019 by sportredwhite
0 like 0 dislike
2 answers
asked Apr 12, 2019 by tupoi
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
28,868 users