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

Swift Weather App: alternative weather api

After finishing the Swift Weather App course I've been playing with using alternative weather api's. I have been able to go through the course again with the alternative api but have stumbled when creating the Current.swift file.

The api that I am using has nested json. In the current course using the forecast.io api you can use the following line when declaring currentWeather in the Current.swift file:

let currentWeather = weatherDictionary["currently"] as NSDictionary

How would you declare currentWeather if you need to access nested JSON for current weather data? Here is what I tried:

let currentWeather = weatherDictionary["response"]["responses"]["response"]["ob"] as NSDictionary

Thank you for any help you can give.