Skip to content

Commit b0ede15

Browse files
authored
Merge pull request #50 from joeljfischer/bug/xcode9.3-fix
Fix Xcode 9.3 error
2 parents ba25031 + 8569fb2 commit b0ede15

File tree

2 files changed

+44
-44
lines changed

2 files changed

+44
-44
lines changed

Source/DataPoint.swift

+42-42
Original file line numberDiff line numberDiff line change
@@ -27,85 +27,85 @@ public struct DataPoint {
2727
public let sunsetTime: Date?
2828

2929
/// The fractional part of the lunation number of the given day. This can be thought of as the "percentage complete" of the current lunar month. A value of `0` represents a new moon, a value of `0.25` represents a first quarter moon, a value of `0.5` represents a full moon, and a value of `0.75` represents a last quarter moon. The ranges between these values represent waxing crescent, waxing gibbous, waning gibbous, and waning crescent moons, respectively. Only defined on `Forecast`'s `daily` `DataPoint`s.
30-
public let moonPhase: Float?
30+
public let moonPhase: Double?
3131

3232
/// The distance to the nearest storm in miles. This value is *very approximate* and should not be used in scenarios requiring accurate results. A storm distance of `0` doesn't necessarily refer to a storm at the requested location, but rather a storm in the vicinity of the requested location. Only defined on `Forecast`'s `currently` `DataPoint`s.
33-
public let nearestStormDistance: Float?
33+
public let nearestStormDistance: Double?
3434

3535
/// The direction of the nearest storm in degrees, with true north at 0º and progressing clockwise. If `nearestStormDistance` is `0`, then this value will be `nil`. The caveats that apply to `nearestStormDistance` apply to this too. Only defined on `Forecast`'s `currently` `DataPoint`s.
36-
public let nearestStormBearing: Float?
36+
public let nearestStormBearing: Double?
3737

3838
/// The average expected intensity in inches of liquid water per hour of precipitation occurring at the given time *conditional on probability* (assuming any precipitation occurs at all). A *very* rough guide is that a value of `0` corresponds to no precipitation, `0.002` corresponds to very light precipitation, `0.017` corresponds to light precipitation, `0.1` corresponds to moderate precipitation, and `0.4` corresponds to heavy precipitation.
39-
public let precipitationIntensity: Float?
39+
public let precipitationIntensity: Double?
4040

4141
/// Maximum expected intensity of precipitation on the given day in inches of liquid water per hour. Only defined on `Forecast`'s `daily` `DataPoint`s.
42-
public let precipitationIntensityMax: Float?
42+
public let precipitationIntensityMax: Double?
4343

4444
/// Time at which the maximum expected intensity of precipitation will occur. Only defined on `Forecast`'s `daily` `DataPoint`s.
4545
public let precipitationIntensityMaxTime: Date?
4646

4747
/// Value between `0` and `1` (inclusive) representing the probability of precipitation occurring at the given time.
48-
public let precipitationProbability: Float?
48+
public let precipitationProbability: Double?
4949

5050
/// Type of precipitation occurring at the given time. If `precipIntensity` is `0`, then this will be `nil`.
5151
public let precipitationType: Precipitation?
5252

5353
/// The amount of snowfall accumulation expected to occur on the given day, in inches. This will be `nil` if no accumulation is expected. Only defined on `Forecast`'s `hourly` and `daily` `DataPoint`s.
54-
public let precipitationAccumulation: Float?
54+
public let precipitationAccumulation: Double?
5555

5656
/// The temperature at the given time in degrees Fahrenheit. Not defined on `Forecast`'s `daily` `DataPoint`s.
57-
public let temperature: Float?
57+
public let temperature: Double?
5858

5959
/// The minimum temperature on the given day in degrees Fahrenheit. Only defined on `Forecast`'s `daily` `DataPoint`s.
60-
public let temperatureMin: Float?
60+
public let temperatureMin: Double?
6161

6262
/// The time at which the minimum temperature will occur on the given day in degrees Fahrenheit. Only defined on `Forecast`'s `daily` `DataPoint`s.
6363
public let temperatureMinTime: Date?
6464

6565
/// The maximum temperature on the given day in degrees Fahrenheit. Only defined on `Forecast`'s `daily` `DataPoint`s.
66-
public let temperatureMax: Float?
66+
public let temperatureMax: Double?
6767

6868
/// The time at which the maximum temperature will occur on the given day in degrees Fahrenheit. Only defined on `Forecast`'s `daily` `DataPoint`s.
6969
public let temperatureMaxTime: Date?
7070

7171
/// The apparent or "feels like" temperature at the given time in degrees Fahrenheit. Not defined on `Forecast`'s `daily` `DataPoint`s.
72-
public let apparentTemperature: Float?
72+
public let apparentTemperature: Double?
7373

7474
/// The minimum apparent or "feels like" temperature on the given day in degrees Fahrenheit. Only defined on `Forecast`'s `daily` `DataPoint`s.
75-
public let apparentTemperatureMin: Float?
75+
public let apparentTemperatureMin: Double?
7676

7777
/// The time at which the minimum apparent or "feels like" temperature will occur on the given day in degrees Fahrenheit. Only defined on `Forecast`'s `daily` `DataPoint`s.
7878
public let apparentTemperatureMinTime: Date?
7979

8080
/// The maximum apparent or "feels like" temperature on the given day in degrees Fahrenheit. Only defined on `Forecast`'s `daily` `DataPoint`s.
81-
public let apparentTemperatureMax: Float?
81+
public let apparentTemperatureMax: Double?
8282

8383
/// The time at which the maximum apparent or "feels like" temperature will occur on the given day in degrees Fahrenheit. Only defined on `Forecast`'s `daily` `DataPoint`s.
8484
public let apparentTemperatureMaxTime: Date?
8585

8686
/// The dew point at the given time in degrees Fahrenheit.
87-
public let dewPoint: Float?
87+
public let dewPoint: Double?
8888

8989
/// The wind speed at the given time in miles per hour.
90-
public let windSpeed: Float?
90+
public let windSpeed: Double?
9191

9292
/// The direction that the wind is coming from in degrees, with true north at 0º and progressing clockwise. If `windSpeed` is `0`, then this will be `nil`.
93-
public let windBearing: Float?
93+
public let windBearing: Double?
9494

9595
/// Value between `0` and `1` (inclusive) representing the percentage of sky occluded by clouds. A value of `0` corresponds to a clear sky, `0.4` corresponds to scattered clouds, `0.75` correspond to broken cloud cover, and `1` corresponds to completely overcast skies.
96-
public let cloudCover: Float?
96+
public let cloudCover: Double?
9797

9898
/// Value between `0` and `1` (inclusive) representing the relative humidity.
99-
public let humidity: Float?
99+
public let humidity: Double?
100100

101101
/// The sea-level air pressure in millibars.
102-
public let pressure: Float?
102+
public let pressure: Double?
103103

104104
/// The average visibility in miles, capped at `10`.
105-
public let visibility: Float?
105+
public let visibility: Double?
106106

107107
/// The columnar density of total atomspheric ozone at the given time in Dobson units.
108-
public let ozone: Float?
108+
public let ozone: Double?
109109

110110
/// Creates a new `DataPoint` from a JSON object.
111111
///
@@ -130,56 +130,56 @@ public struct DataPoint {
130130
} else {
131131
sunsetTime = nil
132132
}
133-
moonPhase = json["moonPhase"] as? Float
134-
nearestStormDistance = json["nearestStormDistance"] as? Float
135-
nearestStormBearing = json["nearestStormBearing"] as? Float
136-
precipitationIntensity = json["precipIntensity"] as? Float
137-
precipitationIntensityMax = json["precipIntensityMax"] as? Float
133+
moonPhase = json["moonPhase"] as? Double
134+
nearestStormDistance = json["nearestStormDistance"] as? Double
135+
nearestStormBearing = json["nearestStormBearing"] as? Double
136+
precipitationIntensity = json["precipIntensity"] as? Double
137+
precipitationIntensityMax = json["precipIntensityMax"] as? Double
138138
if let jsonPrecipitationIntensityMaxTime = json["precipIntensityMaxTime"] as? Double {
139139
precipitationIntensityMaxTime = Date(timeIntervalSince1970: jsonPrecipitationIntensityMaxTime)
140140
} else {
141141
precipitationIntensityMaxTime = nil
142142
}
143-
precipitationProbability = json["precipProbability"] as? Float
143+
precipitationProbability = json["precipProbability"] as? Double
144144
if let jsonPrecipitationType = json["precipType"] as? String {
145145
precipitationType = Precipitation(rawValue: jsonPrecipitationType)
146146
} else {
147147
precipitationType = nil
148148
}
149-
precipitationAccumulation = json["precipAccumulation"] as? Float
150-
temperature = json["temperature"] as? Float
151-
temperatureMin = json["temperatureMin"] as? Float
149+
precipitationAccumulation = json["precipAccumulation"] as? Double
150+
temperature = json["temperature"] as? Double
151+
temperatureMin = json["temperatureMin"] as? Double
152152
if let jsonTemperatureMinTime = json["temperatureMinTime"] as? Double {
153153
temperatureMinTime = Date(timeIntervalSince1970: jsonTemperatureMinTime)
154154
} else {
155155
temperatureMinTime = nil
156156
}
157-
temperatureMax = json["temperatureMax"] as? Float
157+
temperatureMax = json["temperatureMax"] as? Double
158158
if let jsonTemperatureMaxTime = json["temperatureMaxTime"] as? Double {
159159
temperatureMaxTime = Date(timeIntervalSince1970: jsonTemperatureMaxTime)
160160
} else {
161161
temperatureMaxTime = nil
162162
}
163-
apparentTemperature = json["apparentTemperature"] as? Float
164-
apparentTemperatureMin = json["apparentTemperatureMin"] as? Float
163+
apparentTemperature = json["apparentTemperature"] as? Double
164+
apparentTemperatureMin = json["apparentTemperatureMin"] as? Double
165165
if let jsonApparentTemperatureMinTime = json["apparentTemperatureMinTime"] as? Double {
166166
apparentTemperatureMinTime = Date(timeIntervalSince1970: jsonApparentTemperatureMinTime)
167167
} else {
168168
apparentTemperatureMinTime = nil
169169
}
170-
apparentTemperatureMax = json["apparentTemperatureMax"] as? Float
170+
apparentTemperatureMax = json["apparentTemperatureMax"] as? Double
171171
if let jsonApparentTemperatureMaxTime = json["apparentTemperatureMaxTime"] as? Double {
172172
apparentTemperatureMaxTime = Date(timeIntervalSince1970: jsonApparentTemperatureMaxTime)
173173
} else {
174174
apparentTemperatureMaxTime = nil
175175
}
176-
dewPoint = json["dewPoint"] as? Float
177-
windSpeed = json["windSpeed"] as? Float
178-
windBearing = json["windBearing"] as? Float
179-
cloudCover = json["cloudCover"] as? Float
180-
humidity = json["humidity"] as? Float
181-
pressure = json["pressure"] as? Float
182-
visibility = json["visibility"] as? Float
183-
ozone = json["ozone"] as? Float
176+
dewPoint = json["dewPoint"] as? Double
177+
windSpeed = json["windSpeed"] as? Double
178+
windBearing = json["windBearing"] as? Double
179+
cloudCover = json["cloudCover"] as? Double
180+
humidity = json["humidity"] as? Double
181+
pressure = json["pressure"] as? Double
182+
visibility = json["visibility"] as? Double
183+
ozone = json["ozone"] as? Double
184184
}
185185
}

Source/Forecast.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import Foundation
1212
public struct Forecast {
1313

1414
/// The requested latitude.
15-
public let latitude: Float
15+
public let latitude: Double
1616

1717
/// The requested longitude.
18-
public let longitude: Float
18+
public let longitude: Double
1919

2020
/// The IANA timezone name for the requested location (e.g. "America/New_York"). Rely on local user settings over this property.
2121
public let timezone: String

0 commit comments

Comments
 (0)