After updating IOS from 17.1.2 to 17.4.1, the display of some countries in TableView changed, for example, Taiwan became Root(Taiwn), Macau also became Root(Makao) and the same with Hong Kong and China. The cat has not changed and worked correctly for more than one year.
private func createCountriesByLang(lang: Langs) -> [CountryModel] {
var result = [CountryModel]()
for code in NSLocale.isoCountryCodes {
let id = NSLocale.localeIdentifier(fromComponents: [NSLocale.Key.countryCode.rawValue: code])
let name = NSLocale(localeIdentifier: lang.rawValue).displayName(forKey: NSLocale.Key.identifier, value: id) ?? "Country not found for code: (code)"
result.append(CountryModel(name: name, code: code))
}
switch lang {
case Langs.en:
result.append(CountryModel(name: "Zaire", code: "ZR"))
result.append(CountryModel(name: "British Indian Ocean Territory", code: "IO"))
result.append(CountryModel(name: "Netherlands Antilles", code: "AN"))
case Langs.ru:
result.append(CountryModel(name: "Заир", code: "ZR"))
result.append(CountryModel(name: "Британская Территория в Индийском Океане", code: "IO"))
result.append(CountryModel(name: "Нидерландские Антильские о-ва", code: "AN"))
case Langs.zh:
result.append(CountryModel(name: "扎伊尔", code: "ZR"))
result.append(CountryModel(name: "英属印度洋领地", code: "IO"))
result.append(CountryModel(name: "荷属安的列斯", code: "AN"))
}
return result
}