Skip to content

Commit

Permalink
Small improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Fri3ndlyGerman committed Feb 12, 2017
1 parent a601a61 commit 0a5db02
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions OpenWeatherSwift.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "OpenWeatherSwift"
s.version = "0.2.4"
s.version = "0.2.5"
s.summary = "An API for OpenWeatherMap.org written in Swift"

s.homepage = "https://henrikpanhans.de"
Expand All @@ -14,7 +14,7 @@ Pod::Spec.new do |s|
s.ios.deployment_target = "8.0"
s.watchos.deployment_target = "2.0"

s.source = { :git => 'https://github.com/Fri3ndlyGerman/OpenWeatherSwift.git', :tag => "0.2.4" }
s.source = { :git => 'https://github.com/Fri3ndlyGerman/OpenWeatherSwift.git', :tag => "0.2.5" }

s.source_files = "OpenWeatherSwift", "OpenWeatherSwift/*.{plist,h,swift}"

Expand Down
Binary file not shown.
18 changes: 9 additions & 9 deletions OpenWeatherSwift/Forecast.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ public struct Forecast {

let subdata = data["list"]

for (index,subJson):(String, JSON) in subdata {
self.temperatures.append(subJson["main"]["temp"].intValue)
self.clouds.append(Float(100/subJson["clouds"]["all"].intValue))
self.conditions.append(subJson["weather"]["main"].stringValue)
self.pressures.append(subJson["main"]["pressure"].intValue)
self.humidities.append(Float(100/subJson["main"]["humidity"].intValue))
for subJSON in subdata.array! {
self.temperatures.append(subJSON["main"]["temp"].intValue)
self.clouds.append(subJSON["clouds"]["all"].floatValue)
self.conditions.append(subJSON["weather"]["main"].stringValue)
self.pressures.append(subJSON["main"]["pressure"].intValue)
self.humidities.append(subJSON["main"]["humidity"].floatValue)
}
} else {
self.city = data["city"]["name"].stringValue
Expand All @@ -47,12 +47,12 @@ public struct Forecast {

let subdata = data["list"]

for (index,subJson):(String, JSON) in subdata {
for subJson in subdata.array! {
self.temperatures.append(subJson["main"]["temp"].intValue)
self.clouds.append(Float(100/subJson["clouds"]["all"].intValue))
self.clouds.append(subJson["clouds"]["all"].floatValue)
self.conditions.append(subJson["weather"]["main"].stringValue)
self.pressures.append(subJson["main"]["pressure"].intValue)
self.humidities.append(Float(100/subJson["main"]["humidity"].intValue))
self.humidities.append(subJson["main"]["humidity"].floatValue)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion OpenWeatherSwift/Weather.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public struct Weather {
public init(data: JSON) {
self.humidity = data["main"]["humidity"].intValue
self.id = data["id"].intValue
self.clouds = 100/data["clouds"]["all"].floatValue
self.clouds = data["clouds"]["all"].floatValue
self.country = data["sys"]["country"].stringValue
self.visibility = data["visibility"].intValue
self.airPressure = data["main"]["pressure"].intValue
Expand Down

0 comments on commit 0a5db02

Please sign in to comment.