2

I get list of countries with :

let countries = NSLocale.isoCountryCodes.map { (code:String) -> String in
    let id = NSLocale.localeIdentifier(fromComponents: [NSLocale.Key.countryCode.rawValue: code])
    return NSLocale(localeIdentifier: "en_US").displayName(forKey: NSLocale.Key.identifier, value: id) ?? "Country not found for code: \(code)"
}

How can I get a list of cities for a certain country ?

Thank you.

Alladinian
  • 34,483
  • 6
  • 89
  • 91
Curnelious
  • 1
  • 16
  • 76
  • 150
  • https://stackoverflow.com/questions/44031257/find-city-name-and-country-from-latitude-and-longitude-in-swift – KhanShaheb Dec 13 '17 at 10:14
  • thanks, this seems to open gps or go to google API ? I was thinking that if Apple provides countries list, it also has cities list. – Curnelious Dec 13 '17 at 10:16

0 Answers0