Skip to content

Commit

Permalink
Renamed all folder to match new project name
Browse files Browse the repository at this point in the history
  • Loading branch information
henrik-dmg committed Jan 8, 2019
1 parent f9cc4da commit 0a863a4
Show file tree
Hide file tree
Showing 10 changed files with 402 additions and 69 deletions.
36 changes: 7 additions & 29 deletions HPOpenWeather.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

/* Begin PBXBuildFile section */
1B1328C85E81910AE08C0670 /* Pods_HPOpenWeather.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 546B25B43D6E5AB205ED1FE1 /* Pods_HPOpenWeather.framework */; };
4909D34302201B0D36ED0AA7 /* Pods_OpenWeatherSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABEF7AAF1618FE04518D6EAD /* Pods_OpenWeatherSwift.framework */; };
AF5ABCFF1E508091008D0857 /* Forecast.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF5ABCFE1E508091008D0857 /* Forecast.swift */; };
AF7B02E01E5074950083F35F /* Weather.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF7B02DF1E5074950083F35F /* Weather.swift */; };
AFCD309D1E4F7B1800545890 /* OpenWeatherSwift.h in Headers */ = {isa = PBXBuildFile; fileRef = AFCD309B1E4F7B1800545890 /* OpenWeatherSwift.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand All @@ -17,30 +16,23 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
36763E9BA8D1C5B323F5003E /* Pods-OpenWeatherSwift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OpenWeatherSwift.debug.xcconfig"; path = "Pods/Target Support Files/Pods-OpenWeatherSwift/Pods-OpenWeatherSwift.debug.xcconfig"; sourceTree = "<group>"; };
546B25B43D6E5AB205ED1FE1 /* Pods_HPOpenWeather.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HPOpenWeather.framework; sourceTree = BUILT_PRODUCTS_DIR; };
795E58A63F19CC4F29AA7561 /* Pods-HPOpenWeather.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HPOpenWeather.debug.xcconfig"; path = "Pods/Target Support Files/Pods-HPOpenWeather/Pods-HPOpenWeather.debug.xcconfig"; sourceTree = "<group>"; };
ABEF7AAF1618FE04518D6EAD /* Pods_OpenWeatherSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_OpenWeatherSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
AF5ABCFE1E508091008D0857 /* Forecast.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Forecast.swift; sourceTree = "<group>"; };
AF7B02DF1E5074950083F35F /* Weather.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Weather.swift; sourceTree = "<group>"; };
AFAB24281E50846700F2D31B /* OpenWeatherSwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenWeatherSwiftTests.swift; sourceTree = "<group>"; };
AFAB242A1E50846700F2D31B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
AFCD30981E4F7B1800545890 /* HPOpenWeather.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HPOpenWeather.framework; sourceTree = BUILT_PRODUCTS_DIR; };
AFCD309B1E4F7B1800545890 /* OpenWeatherSwift.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OpenWeatherSwift.h; sourceTree = "<group>"; };
AFCD309C1E4F7B1800545890 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
AFCD30A31E4F7B2B00545890 /* HPOpenWeather.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HPOpenWeather.swift; sourceTree = "<group>"; };
B104D0A99E9F2BAADFCA60C8 /* Pods-HPOpenWeather.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HPOpenWeather.release.xcconfig"; path = "Pods/Target Support Files/Pods-HPOpenWeather/Pods-HPOpenWeather.release.xcconfig"; sourceTree = "<group>"; };
C3DF2C1D2123226F00D8B636 /* HPOpenWeather.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HPOpenWeather.podspec; sourceTree = SOURCE_ROOT; };
C82EA37D12FF0D9BD33D4A3F /* Pods_OpenWeatherSwiftTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_OpenWeatherSwiftTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
EF51520C2CDE45D3E5186CD8 /* Pods-OpenWeatherSwift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OpenWeatherSwift.release.xcconfig"; path = "Pods/Target Support Files/Pods-OpenWeatherSwift/Pods-OpenWeatherSwift.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
AFCD30941E4F7B1800545890 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4909D34302201B0D36ED0AA7 /* Pods_OpenWeatherSwift.framework in Frameworks */,
1B1328C85E81910AE08C0670 /* Pods_HPOpenWeather.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -51,8 +43,6 @@
2020E830BEF3625D7EF90628 /* Pods */ = {
isa = PBXGroup;
children = (
36763E9BA8D1C5B323F5003E /* Pods-OpenWeatherSwift.debug.xcconfig */,
EF51520C2CDE45D3E5186CD8 /* Pods-OpenWeatherSwift.release.xcconfig */,
795E58A63F19CC4F29AA7561 /* Pods-HPOpenWeather.debug.xcconfig */,
B104D0A99E9F2BAADFCA60C8 /* Pods-HPOpenWeather.release.xcconfig */,
);
Expand All @@ -62,28 +52,16 @@
832BC8D608201E720E1FE47A /* Frameworks */ = {
isa = PBXGroup;
children = (
ABEF7AAF1618FE04518D6EAD /* Pods_OpenWeatherSwift.framework */,
C82EA37D12FF0D9BD33D4A3F /* Pods_OpenWeatherSwiftTests.framework */,
546B25B43D6E5AB205ED1FE1 /* Pods_HPOpenWeather.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
AFAB24271E50846700F2D31B /* OpenWeatherSwiftTests */ = {
isa = PBXGroup;
children = (
AFAB24281E50846700F2D31B /* OpenWeatherSwiftTests.swift */,
AFAB242A1E50846700F2D31B /* Info.plist */,
);
path = OpenWeatherSwiftTests;
sourceTree = "<group>";
};
AFCD308E1E4F7B1800545890 = {
isa = PBXGroup;
children = (
C3DF2C1D2123226F00D8B636 /* HPOpenWeather.podspec */,
AFCD309A1E4F7B1800545890 /* OpenWeatherSwift */,
AFAB24271E50846700F2D31B /* OpenWeatherSwiftTests */,
AFCD309A1E4F7B1800545890 /* HPOpenWeather */,
AFCD30991E4F7B1800545890 /* Products */,
2020E830BEF3625D7EF90628 /* Pods */,
832BC8D608201E720E1FE47A /* Frameworks */,
Expand All @@ -98,7 +76,7 @@
name = Products;
sourceTree = "<group>";
};
AFCD309A1E4F7B1800545890 /* OpenWeatherSwift */ = {
AFCD309A1E4F7B1800545890 /* HPOpenWeather */ = {
isa = PBXGroup;
children = (
AFCD30A31E4F7B2B00545890 /* HPOpenWeather.swift */,
Expand All @@ -107,7 +85,7 @@
AFCD309B1E4F7B1800545890 /* OpenWeatherSwift.h */,
AFCD309C1E4F7B1800545890 /* Info.plist */,
);
path = OpenWeatherSwift;
path = HPOpenWeather;
sourceTree = "<group>";
};
/* End PBXGroup section */
Expand Down Expand Up @@ -352,11 +330,11 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = OpenWeatherSwift/Info.plist;
INFOPLIST_FILE = "$(SRCROOT)/HPOpenWeather/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.henrikpanhans.OpenWeatherSwift;
PRODUCT_BUNDLE_IDENTIFIER = com.henrikpanhans.HPOpenWeather;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -375,11 +353,11 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = OpenWeatherSwift/Info.plist;
INFOPLIST_FILE = "$(SRCROOT)/HPOpenWeather/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.henrikpanhans.OpenWeatherSwift;
PRODUCT_BUNDLE_IDENTIFIER = com.henrikpanhans.HPOpenWeather;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>HPOpenWeather.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>3</integer>
</dict>
<key>OpenWeatherSwift.xcscheme_^#shared#^_</key>
<dict>
Expand Down
5 changes: 1 addition & 4 deletions HPOpenWeather.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
92 changes: 92 additions & 0 deletions HPOpenWeather/Forecast.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
//
// Forecast.swift
// OpenWeatherSwift
//
// Created by Henrik Panhans on 12.02.17.
// Copyright © 2017 Henrik Panhans. All rights reserved.
//

import SwiftyJSON

public enum ForecastType: String {
case Hourly = "http://api.openweathermap.org/data/2.5/forecast?";
case Daily = "http://api.openweathermap.org/data/2.5/forecast/daily?"
}

public class Forecast {
public var city: String = ""
public var country: String = ""
public var cityID: String = ""
public var tempNight = [Double]()
public var tempMin = [Double]()
public var tempEve = [Double]()
public var tempDay = [Double]()
public var tempMax = [Double]()
public var tempMorn = [Double]()
public var clouds = [Double]()
public var conditions = [String]()
public var pressures = [Double]()
public var humidities = [Double]()
public var rain = [Double]()
public var dates = [Date]()
public var dt = [Double]()
public var icon = [String]()
// public var weatherSmallDesc = [String]()
// public var weatherDesc = [String]()

public init(data: JSON, type: ForecastType) {
if type == .Hourly {
// self.city = data["city"]["name"].stringValue
// self.country = data["city"]["country"].stringValue
// self.cityID = data["city"]["id"].stringValue
//
// let subdata = data["list"]
//
// for subJSON in subdata.array! {
// self.temperatures.append(subJSON["main"]["temp"].doubleValue)
// self.clouds.append(subJSON["clouds"]["all"].doubleValue)
// self.conditions.append(subJSON["weather"]["main"].stringValue)
// self.pressures.append(subJSON["main"]["pressure"].doubleValue)
// self.humidities.append(subJSON["main"]["humidity"].doubleValue)
// self.rain.append(subJSON["rain"]["3h"].doubleValue)
// self.icon.append(subJSON["weather"][0]["icon"].stringValue)
// self.dt.append(subJSON["dt"].doubleValue)
//
//// let date = subJSON["dt_txt"].stringValue.convertToDate(withFormat: "yyyy-MM-dd HH:mm:ss")
// let date = NSDate(timeIntervalSince1970: subJSON["dt"].doubleValue)
//
// self.dates.append(date as Date)
// }
} else {
self.city = data["city"]["name"].stringValue
self.country = data["city"]["country"].stringValue
self.cityID = data["city"]["id"].stringValue

let subdata = data["list"]

for subJson in subdata.array! {
self.tempNight.append(subJson["temp"]["night"].doubleValue)
self.tempMin.append(subJson["temp"]["min"].doubleValue)
self.tempEve.append(subJson["temp"]["eve"].doubleValue)
self.tempDay.append(subJson["temp"]["day"].doubleValue)
self.tempMax.append(subJson["temp"]["max"].doubleValue)
self.tempMorn.append(subJson["temp"]["morn"].doubleValue)

self.conditions.append(subJson["weather"]["description"].stringValue)
self.clouds.append(subJson["clouds"].doubleValue)
self.pressures.append(subJson["pressure"].doubleValue)
self.humidities.append(subJson["humidity"].doubleValue)
self.icon.append(subJson["weather"][0]["icon"].stringValue)
// self.weatherSmallDesc(subJson["weather"][0]["main"].stringValue)
// self.weatherDesc(subJson["weather"][0]["description"].stringValue)


self.dt.append(subJson["dt"].doubleValue)

let date = NSDate(timeIntervalSince1970: subJson["dt"].doubleValue)

self.dates.append(date as Date)
}
}
}
}
Loading

0 comments on commit 0a863a4

Please sign in to comment.