Skip to content

Commit 2cbf821

Browse files
committed
Update the Xcode version.
1 parent 88cdede commit 2cbf821

File tree

8 files changed

+132
-22
lines changed

8 files changed

+132
-22
lines changed

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github "Alamofire/Alamofire" "1.2.0"
1+
github "Alamofire/Alamofire" "1.2.1"
22
github "SwiftyJSON/SwiftyJSON" "2.2.0"

Carthage/Checkouts/Alamofire/Alamofire.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'Alamofire'
3-
s.version = '1.2.0'
3+
s.version = '1.2.1'
44
s.license = 'MIT'
55
s.summary = 'Elegant HTTP Networking in Swift'
66
s.homepage = 'https://github.com/Alamofire/Alamofire'

Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/project.pbxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
F829C6C31A7A950600A2CD59 /* DownloadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */; };
2323
F829C6C41A7A950600A2CD59 /* AuthenticationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */; };
2424
F829C6C51A7A950600A2CD59 /* ValidationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */; };
25+
F86AEFE71AE6A312007D9C76 /* TLSEvaluationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */; };
26+
F86AEFE81AE6A315007D9C76 /* TLSEvaluationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */; };
2527
F8858DDD19A96B4300F55F93 /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5D19A9674D0040E7D1 /* RequestTests.swift */; };
2628
F8858DDE19A96B4400F55F93 /* ResponseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */; };
2729
F897FF4119AA800700AB5182 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897FF4019AA800700AB5182 /* Alamofire.swift */; };
@@ -60,6 +62,7 @@
6062
F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResponseTests.swift; sourceTree = "<group>"; };
6163
F8111E5F19A9674D0040E7D1 /* UploadTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UploadTests.swift; sourceTree = "<group>"; };
6264
F829C6B21A7A94F100A2CD59 /* Alamofire OSX Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Alamofire OSX Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
65+
F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLSEvaluationTests.swift; sourceTree = "<group>"; };
6366
F897FF4019AA800700AB5182 /* Alamofire.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Alamofire.swift; sourceTree = "<group>"; };
6467
F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidationTests.swift; sourceTree = "<group>"; };
6568
F8D1C6F419D52968002E74FE /* ManagerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManagerTests.swift; sourceTree = "<group>"; };
@@ -148,6 +151,7 @@
148151
F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */,
149152
F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */,
150153
F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */,
154+
F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */,
151155
F8111E4019A95C8B0040E7D1 /* Supporting Files */,
152156
);
153157
path = Tests;
@@ -350,6 +354,7 @@
350354
isa = PBXSourcesBuildPhase;
351355
buildActionMask = 2147483647;
352356
files = (
357+
F86AEFE71AE6A312007D9C76 /* TLSEvaluationTests.swift in Sources */,
353358
F8858DDD19A96B4300F55F93 /* RequestTests.swift in Sources */,
354359
F8E6024519CB46A800A3E7F1 /* AuthenticationTests.swift in Sources */,
355360
F8858DDE19A96B4400F55F93 /* ResponseTests.swift in Sources */,
@@ -373,6 +378,7 @@
373378
F829C6C31A7A950600A2CD59 /* DownloadTests.swift in Sources */,
374379
F829C6C41A7A950600A2CD59 /* AuthenticationTests.swift in Sources */,
375380
F829C6C51A7A950600A2CD59 /* ValidationTests.swift in Sources */,
381+
F86AEFE81AE6A315007D9C76 /* TLSEvaluationTests.swift in Sources */,
376382
);
377383
runOnlyForDeploymentPostprocessing = 0;
378384
};

Carthage/Checkouts/Alamofire/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Alamofire is an HTTP networking library written in Swift, from the [creator](htt
2020
## Requirements
2121

2222
- iOS 7.0+ / Mac OS X 10.9+
23-
- Xcode 6.1
23+
- Xcode 6.3
2424

2525
## Communication
2626

@@ -35,8 +35,6 @@ Alamofire is an HTTP networking library written in Swift, from the [creator](htt
3535
> **Embedded frameworks require a minimum deployment target of iOS 8 or OS X Mavericks.**
3636
>
3737
> To use Alamofire with a project targeting iOS 7, you must include the `Alamofire.swift` source file directly in your project. See the ['Source File'](#source-file) section for instructions.
38-
>
39-
> For Swift 1.2 using the Xcode 6.3 Beta, use the [xcode-6.3 branch](https://github.com/Alamofire/Alamofire/tree/xcode-6.3).
4038
4139
### CocoaPods
4240

@@ -55,7 +53,7 @@ source 'https://github.com/CocoaPods/Specs.git'
5553
platform :ios, '8.0'
5654
use_frameworks!
5755

58-
pod 'Alamofire', '~> 1.1'
56+
pod 'Alamofire', '~> 1.2'
5957
```
6058

6159
Then, run the following command:
@@ -78,7 +76,7 @@ $ brew install carthage
7876
To integrate Alamofire into your Xcode project using Carthage, specify it in your `Cartfile`:
7977

8078
```ogdl
81-
github "Alamofire/Alamofire" >= 1.1
79+
github "Alamofire/Alamofire" >= 1.2
8280
```
8381

8482
### Manually

Carthage/Checkouts/Alamofire/Source/Alamofire.swift

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -781,15 +781,7 @@ public class Request {
781781
if challenge.previousFailureCount > 0 {
782782
disposition = .CancelAuthenticationChallenge
783783
} else {
784-
// TODO: Incorporate Trust Evaluation & TLS Chain Validation
785-
786-
switch challenge.protectionSpace.authenticationMethod! {
787-
case NSURLAuthenticationMethodServerTrust:
788-
credential = NSURLCredential(forTrust: challenge.protectionSpace.serverTrust)
789-
default:
790-
credential = self.credential ?? session.configuration.URLCredentialStorage?.defaultCredentialForProtectionSpace(challenge.protectionSpace)
791-
}
792-
784+
credential = self.credential ?? session.configuration.URLCredentialStorage?.defaultCredentialForProtectionSpace(challenge.protectionSpace)
793785
if credential != nil {
794786
disposition = .UseCredential
795787
}
@@ -1019,11 +1011,17 @@ extension Manager {
10191011

10201012
switch uploadable {
10211013
case .Data(let request, let data):
1022-
uploadTask = session.uploadTaskWithRequest(request, fromData: data)
1014+
dispatch_sync(queue) {
1015+
uploadTask = self.session.uploadTaskWithRequest(request, fromData: data)
1016+
}
10231017
case .File(let request, let fileURL):
1024-
uploadTask = session.uploadTaskWithRequest(request, fromFile: fileURL)
1018+
dispatch_sync(queue) {
1019+
uploadTask = self.session.uploadTaskWithRequest(request, fromFile: fileURL)
1020+
}
10251021
case .Stream(let request, var stream):
1026-
uploadTask = session.uploadTaskWithStreamedRequest(request)
1022+
dispatch_sync(queue) {
1023+
uploadTask = self.session.uploadTaskWithStreamedRequest(request)
1024+
}
10271025
HTTPBodyStream = stream
10281026
}
10291027

@@ -1165,9 +1163,13 @@ extension Manager {
11651163

11661164
switch downloadable {
11671165
case .Request(let request):
1168-
downloadTask = session.downloadTaskWithRequest(request)
1166+
dispatch_sync(queue) {
1167+
downloadTask = self.session.downloadTaskWithRequest(request)
1168+
}
11691169
case .ResumeData(let resumeData):
1170-
downloadTask = session.downloadTaskWithResumeData(resumeData)
1170+
dispatch_sync(queue) {
1171+
downloadTask = self.session.downloadTaskWithResumeData(resumeData)
1172+
}
11711173
}
11721174

11731175
let request = Request(session: session, task: downloadTask)

Carthage/Checkouts/Alamofire/Tests/ResponseTests.swift

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,62 @@ class AlamofireJSONResponseTestCase: XCTestCase {
6767
}
6868
}
6969
}
70+
71+
class AlamofireRedirectResponseTestCase: XCTestCase {
72+
func testGETRequestRedirectResponse() {
73+
let URL = "http://google.com"
74+
let expectation = expectationWithDescription("\(URL)")
75+
76+
let delegate: Alamofire.Manager.SessionDelegate = Alamofire.Manager.sharedInstance.delegate
77+
78+
delegate.taskWillPerformHTTPRedirection = { (session: NSURLSession!, task: NSURLSessionTask!, response: NSHTTPURLResponse!, request: NSURLRequest!) in
79+
// Accept the redirect by returning the updated request.
80+
return request
81+
}
82+
83+
Alamofire.request(.GET, URL)
84+
.response { (request, response, data, error) in
85+
expectation.fulfill()
86+
XCTAssertNotNil(request, "request should not be nil")
87+
XCTAssertNotNil(response, "response should not be nil")
88+
XCTAssertNotNil(data, "data should not be nil")
89+
XCTAssertNil(error, "error should be nil")
90+
91+
XCTAssertEqual(response!.URL!, NSURL(string: "http://www.google.com/")!, "request should have followed a redirect")
92+
}
93+
94+
waitForExpectationsWithTimeout(10) { (error) in
95+
XCTAssertNil(error, "\(error)")
96+
}
97+
}
98+
99+
func testGETRequestDisallowRedirectResponse() {
100+
let URL = "http://google.com/"
101+
let expectation = expectationWithDescription("\(URL)")
102+
103+
let delegate: Alamofire.Manager.SessionDelegate = Alamofire.Manager.sharedInstance.delegate
104+
105+
delegate.taskWillPerformHTTPRedirection = { (session: NSURLSession!, task: NSURLSessionTask!, response: NSHTTPURLResponse!, request: NSURLRequest!) in
106+
// Disallow redirects by returning nil.
107+
// TODO: NSURLSessionDelegate's URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:
108+
// suggests that returning nil should refuse the redirect, but this causes a deadlock/timeout
109+
110+
return NSURLRequest(URL: NSURL(string: URL)!)
111+
}
112+
113+
Alamofire.request(.GET, URL)
114+
.response { (request, response, data, error) in
115+
expectation.fulfill()
116+
XCTAssertNotNil(request, "request should not be nil")
117+
XCTAssertNotNil(response, "response should not be nil")
118+
XCTAssertNotNil(data, "data should not be nil")
119+
XCTAssertNil(error, "error should be nil")
120+
121+
XCTAssertEqual(response!.URL!, NSURL(string: URL)!, "request should not have followed a redirect")
122+
}
123+
124+
waitForExpectationsWithTimeout(10) { (error) in
125+
XCTAssertNil(error, "\(error)")
126+
}
127+
}
128+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// DownloadTests.swift
2+
//
3+
// Copyright (c) 2014–2015 Alamofire (http://alamofire.org)
4+
//
5+
// Permission is hereby granted, free of charge, to any person obtaining a copy
6+
// of this software and associated documentation files (the "Software"), to deal
7+
// in the Software without restriction, including without limitation the rights
8+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
// copies of the Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
//
12+
// The above copyright notice and this permission notice shall be included in
13+
// all copies or substantial portions of the Software.
14+
//
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
// THE SOFTWARE.
22+
23+
import Foundation
24+
import Alamofire
25+
import XCTest
26+
27+
class AlamofireTLSEvaluationTestCase: XCTestCase {
28+
func testSSLCertificateCommonNameValidation() {
29+
let URL = "https://testssl-expire.disig.sk/"
30+
31+
let expectation = expectationWithDescription("\(URL)")
32+
33+
Alamofire.request(.GET, URL)
34+
.response { (_, _, _, error) in
35+
XCTAssertNotNil(error, "error should not be nil")
36+
XCTAssert(error?.code == NSURLErrorServerCertificateUntrusted, "error should be NSURLErrorServerCertificateUntrusted")
37+
38+
expectation.fulfill()
39+
}
40+
41+
waitForExpectationsWithTimeout(10) { (error) in
42+
XCTAssertNil(error, "\(error)")
43+
}
44+
}
45+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Swift Weather
44
SwiftWeather is an iOS weather app developed in Swift language. The app can support iPhone 4(s), iPhone 5(s), iPhone 6 and iPhone 6 Plus. The app also support Today Widgets.
55

66
## Notices
7-
The current version is working with Xcode Version 6.3 (6D570), I have been updating the app to spport the lastest version of Xcode, if you have any issue, please check the Xcode version. If there is still a problem with the supported version, please raise an issue, thanks.
7+
The current version is working with Xcode Version 6.3 (6D570) and Version 6.3.1 (6D1002), I have been updating the app to spport the lastest version of Xcode, if you have any issue, please check the Xcode version. If there is still a problem with the supported versions, please raise an issue, thanks.
88

99
## Version 2
1010
This is version 2. I have ugraded the entire project to use [Carthage](https://github.com/Carthage/Carthage), [Alamofire](https://github.com/Alamofire/Alamofire) and [SwiftyJSON](https://github.com/SwiftyJSON/SwiftyJSON). And the app can only support iOS8+, if you want to support iOS7 or use CocoaPods and AFNetworking. Please have a look at [README.v1.md](https://github.com/JakeLin/SwiftWeather/blob/master/README.v1.md) and Release [Using Cocoapods and AFNetworking](https://github.com/JakeLin/SwiftWeather/releases/tag/V1). Happy coding.

0 commit comments

Comments
 (0)