Skip to content

Commit

Permalink
Bumping pod version
Browse files Browse the repository at this point in the history
  • Loading branch information
Fri3ndlyGerman committed Feb 12, 2017
1 parent ab23619 commit bcc1c2a
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 7 deletions.
6 changes: 3 additions & 3 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.1.0"
s.version = "0.2.0"
s.summary = "An API for OpenWeatherMap.org written in Swift"

s.homepage = "https://henrikpanhans.de"
Expand All @@ -11,10 +11,10 @@ Pod::Spec.new do |s|
s.author = { "Fri3ndlyGerman" => "contact@henrikpanhans.de" }
s.social_media_url = "https://twitter.com/HPanhans"

s.ios.deployment_target = "9.0"
s.ios.deployment_target = "8.0"
s.watchos.deployment_target = "2.0"

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

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

Expand Down
9 changes: 9 additions & 0 deletions OpenWeatherSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
objects = {

/* Begin PBXBuildFile section */
AF7B02E01E5074950083F35F /* Weather.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF7B02DF1E5074950083F35F /* Weather.swift */; };
AFBA5A1E1E50678F009EA7EF /* OpenWeatherSwift.podspec in Resources */ = {isa = PBXBuildFile; fileRef = AFBA5A1D1E50678F009EA7EF /* OpenWeatherSwift.podspec */; };
AFCD309D1E4F7B1800545890 /* OpenWeatherSwift.h in Headers */ = {isa = PBXBuildFile; fileRef = AFCD309B1E4F7B1800545890 /* OpenWeatherSwift.h */; settings = {ATTRIBUTES = (Public, ); }; };
AFCD30A41E4F7B2B00545890 /* OpenWeatherSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCD30A31E4F7B2B00545890 /* OpenWeatherSwift.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
AF7B02DF1E5074950083F35F /* Weather.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Weather.swift; sourceTree = "<group>"; };
AFBA5A1D1E50678F009EA7EF /* OpenWeatherSwift.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OpenWeatherSwift.podspec; sourceTree = SOURCE_ROOT; };
AFCD30981E4F7B1800545890 /* OpenWeatherSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OpenWeatherSwift.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>"; };
Expand Down Expand Up @@ -48,7 +52,9 @@
AFCD309A1E4F7B1800545890 /* OpenWeatherSwift */ = {
isa = PBXGroup;
children = (
AFBA5A1D1E50678F009EA7EF /* OpenWeatherSwift.podspec */,
AFCD30A31E4F7B2B00545890 /* OpenWeatherSwift.swift */,
AF7B02DF1E5074950083F35F /* Weather.swift */,
AFCD309B1E4F7B1800545890 /* OpenWeatherSwift.h */,
AFCD309C1E4F7B1800545890 /* Info.plist */,
);
Expand Down Expand Up @@ -126,6 +132,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
AFBA5A1E1E50678F009EA7EF /* OpenWeatherSwift.podspec in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -136,6 +143,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
AF7B02E01E5074950083F35F /* Weather.swift in Sources */,
AFCD30A41E4F7B2B00545890 /* OpenWeatherSwift.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -304,6 +312,7 @@
AFCD30A21E4F7B1800545890 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
Binary file not shown.
45 changes: 41 additions & 4 deletions OpenWeatherSwift/OpenWeatherSwift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public enum Language : String {

public class OpenWeatherSwift {

private let currentBase = "http://api.openweathermap.org/data/2.5/weather?"
private var params = [String : AnyObject]()
public var temperatureFormat: TemperatureUnit = .Kelvin {
didSet {
Expand Down Expand Up @@ -100,7 +101,7 @@ public class OpenWeatherSwift {
}

public func currentWeatherByCity(name: String, completionHandler: @escaping (_ result: JSON) -> ()) {
let apiURL = "http://api.openweathermap.org/data/2.5/weather?q=\(name)" + encode(params: params)
let apiURL = currentBase + "q=\(name)" + encode(params: params)

Alamofire.request(apiURL).responseJSON { (response) in
if response.result.isSuccess {
Expand All @@ -112,7 +113,7 @@ public class OpenWeatherSwift {
}

public func currentWeatherByCoordinates(coords: CLLocationCoordinate2D, completionHandler: @escaping (_ result: JSON) -> ()) {
let apiURL = "http://api.openweathermap.org/data/2.5/weather?lat=\(coords.latitude)&lon=\(coords.longitude)" + encode(params: params)
let apiURL = currentBase + "lat=\(coords.latitude)&lon=\(coords.longitude)" + encode(params: params)

Alamofire.request(apiURL).responseJSON { (response) in
if response.result.isSuccess {
Expand All @@ -124,7 +125,7 @@ public class OpenWeatherSwift {
}

public func currentWeatherByID(id: String, completionHandler: @escaping (_ result: Any) -> ()) {
let apiURL = "http://api.openweathermap.org/data/2.5/weather?id=\(id)" + encode(params: params)
let apiURL = currentBase + "id=\(id)" + encode(params: params)

Alamofire.request(apiURL).responseJSON { (response) in
if response.result.isSuccess {
Expand All @@ -136,7 +137,43 @@ public class OpenWeatherSwift {
}

public func currentWeatherByZIP(code: String, countryCode: String, completionHandler: @escaping (_ result: Any) -> ()) {
let apiURL = "http://api.openweathermap.org/data/2.5/weather?zip=\(code),\(countryCode)" + encode(params: params)
let apiURL = currentBase + "zip=\(code),\(countryCode)" + encode(params: params)

Alamofire.request(apiURL).responseJSON { (response) in
if response.result.isSuccess {
let json = JSON(response.result.value as Any)

completionHandler(json)
}
}
}

public func forecastWeatherByCity(name: String, completionHandler: @escaping (_ result: JSON) -> ()) {
let apiURL = "http://api.openweathermap.org/data/2.5/forecast?q=\(name)" + encode(params: params)

Alamofire.request(apiURL).responseJSON { (response) in
if response.result.isSuccess {
let json = JSON(response.result.value as Any)

completionHandler(json)
}
}
}

public func forecastWeatherByCoordinates(coords: CLLocationCoordinate2D, completionHandler: @escaping (_ result: JSON) -> ()) {
let apiURL = "http://api.openweathermap.org/data/2.5/forecast?lat=\(coords.latitude)&lon=\(coords.longitude)" + encode(params: params)

Alamofire.request(apiURL).responseJSON { (response) in
if response.result.isSuccess {
let json = JSON(response.result.value as Any)

completionHandler(json)
}
}
}

public func forecastWeatherByID(id: String, completionHandler: @escaping (_ result: Any) -> ()) {
let apiURL = "http://api.openweathermap.org/data/2.5/forecast?id=\(id)" + encode(params: params)

Alamofire.request(apiURL).responseJSON { (response) in
if response.result.isSuccess {
Expand Down

0 comments on commit bcc1c2a

Please sign in to comment.