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

How to get current location coordinates in Swift 2.0

I was hoping on improving the stormy app and taking the user's current coordinates and displaying weather data from their current location. I have been receiving many different methods but none of them work, can you test it in Xcode before answering?

1 Answer

I had done something similar with that app in the past. I found this guide from Apple to be very helpful (specifically the section titled "Getting the User’s Location"). The code examples are in Objective-C, however it should be fairly straightforward to translate to Swift.

Location and Maps Programming Guide