Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Is there a way to get the whole city list

Hi, I am currently making a weather app in Swift. (Not the one Treehouse teaches) I am using the Yahoo Weather API, so I need the WOEID Code of the city to be able to get the weather. And I also found a website that can determine the WOIED Code based on the city. So basically, I let the user to enter a city or determine his/her location automatically with CLLocationManager, and then sends the city to the website that gives me the WOEID Code, and then use that WOEID code to get the weather from Yahoo. But now I have a problem, which is the website that gives me the WOEID code doesn't have the WOEID code of every single city in the world, for example, it doesn't have Rome. So I cannot get the weather even though the city does exist. Also, letting the user to enter the city isn't really a good choice, they might not know how to spell it, they might misspell it. So I decided to hard code the city and the WOEID code, but I am not sure how can I get the whole city list, do I have to look at my iPhone app, go to the Clock app, go to World Clock, go to the "+", and copy every single city down? Or is there a more efficient way?