List of countries with reverse Apple geocode

I am using Swift to generate reverse geocode in place of the device, getting the country. Then find the index of that country in the array and loop through that index in mine UITableView

.

My problem is that I cannot find the list of country names that Apple will return.

For example, mine UITableView

might have a string called "United States of America" ​​but the country returned by the Apple API is "United States". Mine UITableView

then obviously doesn't scroll to that position.

I thought to traverse the array and make a type contains()

to see if the country returned by Apple is somewhere inside the array element, but that seems like a rather unpleasant way to do both for performance and the fact that it will only resolve SOME cases of the problem.

+3


source to share


1 answer


You can find the official list of ISO country codes (which are returned by reverse geocode) here . Code Alpha-2 is returned.



+1


source







All Articles