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

Location in Stromy Swift app.

So after playing around with Swift I have managed the work on 2 user stories that I wanted to achieve:

1: Make the app use the current location of the device. 2: Manipulate the label that allows the user to know where they weather info is (the name of their location)

I will be honest and I really felt that I sometimes got lucky that things worked :-) But I want to know from the Treehouse Community if I have done somethings correct.

1: Use the View Controller as the CLLocationManagerDelegate - My first instinct was that location should be its own class. but after I thought about it, it actually is its own class, its just that I have not written it. So i do comply with the MVC setup.

2: The Dictionary we use to get the current weather doesn't show the "Timezone" key. I made another dict that didn't have a key "current" so that I could access the timezone key. Is this a good way? Seemed silly to make 2 dictionary's?

So I did this

let locationDict : NSDictionary = weatherDictionary as NSDictionary
let currentWeatherDictionary: NSDictionary = weatherDictionary["currently"] as NSDictionary

You can see my code on the project here: https://github.com/wayneknoesen/Stormy/