Skip to content

Commit 9f52b84

Browse files
committed
Merge pull request #161 from ishkawa/2.0-development
APIKit 2.0
2 parents 1cbf85e + 91e262e commit 9f52b84

File tree

60 files changed

+2564
-2272
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2564
-2272
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
url = https://github.com/antitypical/Result.git
44
[submodule "Carthage/Checkouts/OHHTTPStubs"]
55
path = Carthage/Checkouts/OHHTTPStubs
6-
url = https://github.com/AliSoftware/OHHTTPStubs.git
6+
url = https://github.com/ishkawa/OHHTTPStubs.git

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ script:
1717
- pod lib lint
1818
- set -o pipefail
1919
- xcodebuild test -workspace APIKit.xcworkspace -scheme APIKit | xcpretty -c
20-
- xcodebuild test -workspace APIKit.xcworkspace -scheme APIKit -sdk iphonesimulator -destination 'name=iPhone 6,OS=9.1' | xcpretty -c
21-
- xcodebuild build -workspace APIKit.xcworkspace -scheme APIKit -sdk appletvsimulator -destination 'name=Apple TV 1080p,OS=9.1' | xcpretty -c
20+
- xcodebuild test -workspace APIKit.xcworkspace -scheme APIKit -sdk iphonesimulator | xcpretty -c
21+
- xcodebuild test -workspace APIKit.xcworkspace -scheme APIKit -sdk appletvsimulator | xcpretty -c
2222

2323
before_deploy:
2424
- ./script/import-certificates

APIKit.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "APIKit"
3-
s.version = "1.4.1"
3+
s.version = "2.0.0"
44
s.summary = "A networking library for building type safe web API client in Swift."
55
s.homepage = "https://github.com/ishkawa/APIKit"
66

@@ -9,15 +9,15 @@ Pod::Spec.new do |s|
99
}
1010

1111
s.ios.deployment_target = "8.0"
12-
s.osx.deployment_target = "10.9"
12+
s.osx.deployment_target = "10.10"
1313
if s.respond_to?(:watchos)
1414
s.watchos.deployment_target = "2.0"
1515
end
1616
if s.respond_to?(:tvos)
1717
s.tvos.deployment_target = "9.0"
1818
end
1919

20-
s.source_files = "Sources/*.swift"
20+
s.source_files = "Sources/**/*.{swift,h,m}"
2121
s.source = {
2222
:git => "https://github.com/ishkawa/APIKit.git",
2323
:tag => "#{s.version}",
@@ -26,7 +26,7 @@ Pod::Spec.new do |s|
2626
s.license = {
2727
:type => "MIT",
2828
:text => <<-LICENSE
29-
Copyright (c) 2015 Yosuke Ishikawa
29+
Copyright (c) 2015 - 2016 Yosuke Ishikawa
3030
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3131
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
3232
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

APIKit.xcodeproj/project.pbxproj

Lines changed: 202 additions & 33 deletions
Large diffs are not rendered by default.

Cartfile.private

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "AliSoftware/OHHTTPStubs" ~> 4.6.0
1+
github "ishkawa/OHHTTPStubs" "75f74c9c19620a37f436b38e2bc20a07310b999e"

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github "AliSoftware/OHHTTPStubs" "4.6.0"
1+
github "ishkawa/OHHTTPStubs" "75f74c9c19620a37f436b38e2bc20a07310b999e"
22
github "antitypical/Result" "2.0.0"

Carthage/Checkouts/OHHTTPStubs

Submodule OHHTTPStubs updated 46 files

Configurations/Base.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ VERSION_INFO_PREFIX =
2525
VERSIONING_SYSTEM = apple-generic
2626

2727
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Developer
28-
MACOSX_DEPLOYMENT_TARGET = 10.9
28+
MACOSX_DEPLOYMENT_TARGET = 10.10
2929
IPHONEOS_DEPLOYMENT_TARGET = 8.0
3030
WATCHOS_DEPLOYMENT_TARGET = 2.0
3131
TVOS_DEPLOYMENT_TARGET = 9.0

Demo.playground/Contents.swift

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,10 @@ struct GetRateLimitRequest: GitHubRequestType {
4747
return "/rate_limit"
4848
}
4949

50-
func responseFromObject(object: AnyObject, URLResponse: NSHTTPURLResponse) -> Response? {
51-
guard let dictionary = object as? [String: AnyObject] else {
52-
return nil
53-
}
54-
55-
guard let rateLimit = RateLimit(dictionary: dictionary) else {
56-
return nil
50+
func responseFromObject(object: AnyObject, URLResponse: NSHTTPURLResponse) throws -> Response {
51+
guard let dictionary = object as? [String: AnyObject],
52+
let rateLimit = RateLimit(dictionary: dictionary) else {
53+
throw ResponseError.UnexpectedObject(object)
5754
}
5855

5956
return rateLimit
@@ -66,10 +63,10 @@ let request = GetRateLimitRequest()
6663
Session.sendRequest(request) { result in
6764
switch result {
6865
case .Success(let rateLimit):
69-
debugPrint("count: \(rateLimit.count)")
70-
debugPrint("reset: \(rateLimit.resetDate)")
66+
print("count: \(rateLimit.count)")
67+
print("reset: \(rateLimit.resetDate)")
7168

7269
case .Failure(let error):
73-
debugPrint("error: \(error)")
70+
print("error: \(error)")
7471
}
7572
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<playground version='5.0' target-platform='ios' requires-full-environment='true' display-mode='raw'>
2+
<playground version='5.0' target-platform='ios' display-mode='raw'>
33
<timeline fileName='timeline.xctimeline'/>
44
</playground>

0 commit comments

Comments
 (0)