File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,12 @@ public struct DataPoint {
107
107
/// The columnar density of total atomspheric ozone at the given time in Dobson units.
108
108
public let ozone : Float ?
109
109
110
+ /// The UV index.
111
+ public let uvIndex : Float ?
112
+
113
+ // The time at which the maximum UV index occurs during the given day.
114
+ public let uvIndexTime : Date ?
115
+
110
116
/// Creates a new `DataPoint` from a JSON object.
111
117
///
112
118
/// - parameter json: A JSON object with keys corresponding to the `DataPoint`'s properties.
@@ -181,5 +187,11 @@ public struct DataPoint {
181
187
pressure = json [ " pressure " ] as? Float
182
188
visibility = json [ " visibility " ] as? Float
183
189
ozone = json [ " ozone " ] as? Float
190
+ uvIndex = json [ " uvIndex " ] as? Float
191
+ if let jsonUVIndexTime = json [ " uvIndexTime " ] as? Double {
192
+ uvIndexTime = Date ( timeIntervalSince1970: jsonUVIndexTime)
193
+ } else {
194
+ uvIndexTime = nil
195
+ }
184
196
}
185
197
}
You can’t perform that action at this time.
0 commit comments