File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,8 @@ Many languages are supported (a full list is available [here](https://darksky.ne
83
83
With the ` DarkSkyClient ` , you can make two kinds of requests. The first will get the current ` Forecast ` for a particular location:
84
84
85
85
``` swift
86
- client.getForecast (latitude : myLat, longitude : myLon) { result in
86
+ let myLoc = CLLocationCoordinate2D (latitude : myLat, longitude : myLon)
87
+ client.getForecast (location : myLoc) { result in
87
88
switch result {
88
89
case .success (let currentForecast, let requestMetadata):
89
90
// We got the current forecast!
@@ -96,7 +97,8 @@ client.getForecast(latitude: myLat, longitude: myLon) { result in
96
97
The second kind of request is called a time machine request, and it will get a ` Forecast ` for a particular location at a particular time:
97
98
98
99
``` swift
99
- client.getForecast (latitude : myLat, longitude : myLon, time : myTime) { result in
100
+ let myLoc = CLLocationCoordinate2D (latitude : myLat, longitude : myLon)
101
+ client.getForecast (location : myLoc, time : myTime) { result in
100
102
switch result {
101
103
case .success (let forecast, let requestMetadata):
102
104
// We got the forecast!
You can’t perform that action at this time.
0 commit comments