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 trialKevin Murphy
24,380 PointsQuestion about endpoint relative to forecast.io API docs
The forecast.io api docs say there are two types of requests:
- - A forecast request: https://api.forecast.io/forecast/APIKEY/LATITUDE,LONGITUDE
- - A time machine request: https://api.forecast.io/forecast/APIKEY/LATITUDE,LONGITUDE,TIME
Want to ensure I am understanding clearly what is meant by endpoint relative to a request. Would adding a second endpoint member to the the Forecast enum look like this?:
enum Forecast: Endpoint {
case ForecastCurrent(apiKey: String, coordinate: Coordinate)
case TimeMachine(apiKey: String, coordinate: Coordinate, time: NSTimeInterval)
2 Answers
Anthony Boutinov
13,844 PointsYou've answered your question yourself)
Kevin Murphy
24,380 PointsOk good to know, Thanks for the feedback guys
Hemanth C
8,970 PointsHemanth C
8,970 PointsYes thats right, if you are planning to use unix time.