├── .gitmodules
├── GRequest.xcodeproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
├── xcuserdata
│ └── aemaeth.xcuserdatad
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── GRequest.xcscheme
└── project.pbxproj
├── GRequest
├── GRequest.h
├── Info.plist
└── GRequest.swift
├── GRequestTests
├── Info.plist
└── GRequestTests.swift
└── README.md
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "SwiftyJSON"]
2 | path = SwiftyJSON
3 | url = https://github.com/lingoer/SwiftyJSON.git
4 |
--------------------------------------------------------------------------------
/GRequest.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/GRequest/GRequest.h:
--------------------------------------------------------------------------------
1 | //
2 | // GRequest.h
3 | // GRequest
4 | //
5 | // Created by Ruoyu Fu on 14-7-5.
6 | // Copyright (c) 2014年 Roy Fu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for GRequest.
12 | FOUNDATION_EXPORT double GRequestVersionNumber;
13 |
14 | //! Project version string for GRequest.
15 | FOUNDATION_EXPORT const unsigned char GRequestVersionString[];
16 |
17 | // In this header, you should import all the public headers of your framework using statements like #import
18 |
19 |
20 |
--------------------------------------------------------------------------------
/GRequest.xcodeproj/xcuserdata/aemaeth.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | GRequest.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 1738F8751967ECC0006F5A69
16 |
17 | primary
18 |
19 |
20 | 1738F8801967ECC0006F5A69
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/GRequestTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | RoyF.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/GRequest/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | RoyF.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/GRequestTests/GRequestTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GRequestTests.swift
3 | // GRequestTests
4 | //
5 | // Created by Ruoyu Fu on 14-7-5.
6 | // Copyright (c) 2014年 Roy Fu. All rights reserved.
7 | //
8 |
9 | import XCTest
10 |
11 | class GRequestTests: XCTestCase {
12 |
13 | override func setUp() {
14 | super.setUp()
15 | // Put setup code here. This method is called before the invocation of each test method in the class.
16 | }
17 |
18 | override func tearDown() {
19 | // Put teardown code here. This method is called after the invocation of each test method in the class.
20 | super.tearDown()
21 | }
22 |
23 | func testExample() {
24 | // This is an example of a functional test case.
25 | XCTAssert(true, "Pass")
26 | }
27 |
28 | func testPerformanceExample() {
29 | // This is an example of a performance test case.
30 | self.measureBlock() {
31 | // Put the code you want to measure the time of here.
32 | }
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/GRequest.xcodeproj/xcuserdata/aemaeth.xcuserdatad/xcschemes/GRequest.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
52 |
53 |
54 |
55 |
61 |
62 |
64 |
65 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | GRequest
2 | ========
3 |
4 | An HTTP request library written in Swift.
5 |
6 | ##Basic Usage
7 | Be simple, as it should be:
8 |
9 | ```Swift
10 | Request("https://api.github.com/repos/lingoer/SwiftyJSON/issues").get{
11 | response in
12 | println(response.content)//HTTP Body as NSData
13 | }
14 | ```
15 | If you need more infomation:
16 |
17 | ```Swift
18 | Request("https://api.github.com/repos/lingoer/SwiftyJSON/issues").get{
19 | response in
20 | println(response.headers)
21 | println(response.MIMEType)
22 | println(response.statusCode)
23 | println(response.encoding)
24 | println(response.error)
25 | println(response.content)//HTTP Body as NSData
26 | println(response.string)//HTTP Body as String
27 | println(response.object)//HTTP Body as Deserialized Custom Object, Default is NSData. See Below for more info
28 | }
29 | ```
30 |
31 | Use ```.query()``` to pass parameters for GET methods
32 |
33 |
34 | ```Swift
35 | Request("www.example.com/api").query(["labels":"discuss"]).get{
36 | response in
37 | }
38 | ```
39 | As for POST:
40 |
41 | ```Swift
42 | //This will encode body as application/x-www-form-urlencoded
43 | Request("http://www.example.com").formBody(["key":"value"]).post{
44 | response in
45 | }
46 | ```
47 |
48 | ```Swift
49 | //This will encode body as application/json
50 | Request("http://www.example.com").jsonBody(["key":"value"]).post{
51 | response in
52 | }
53 | ```
54 | ```Swift
55 | //You can custom your HTTP Body to POST, with Content-Type provided after it.
56 | Request("http://www.example.com").body(customBodyData, typeString:"application/json; charset=utf-8").post{
57 | response in
58 | }
59 | ```
60 |
61 | More:
62 |
63 | ```Swift
64 | Request("http://www.example.com").head{
65 | response in
66 | }
67 | Request("http://www.example.com").put{
68 | response in
69 | }
70 | Request("http://www.example.com").delete{
71 | response in
72 | }
73 | Request("http://www.example.com").patch{
74 | response in
75 | }
76 | ```
77 |
78 | ##Instances And Chainnings
79 |
80 | A Request is in fact a ```GRequest```
81 |
82 | It's ```typealias Request = GRequest``` as default.
83 |
84 | And a ```GRequest``` is a Generic class specifiying the behavior of the response.
85 |
86 | Most methods returns an instance of the ```GRequest``` to make chains.
87 |
88 | For example ```.path()```:
89 |
90 | ```Swift
91 | Request("https://api.github.com").path("/repos/lingoer/SwiftyJSON/issues").get{
92 | response in
93 | }
94 |
95 | ```
96 | ###Response Deserialization
97 | As for the response behavior.
98 |
99 | It's mostly about Response Deserialization:
100 |
101 | ```Swift
102 | Request("https://api.github.com/repos/lingoer/SwiftyJSON/issues").query(["labels":"discuss"]).get{
103 | (response:GResponse) in
104 | println(response.object)//It's JSON Now
105 | }
106 | ```
107 | ***Note for more infomation about the ```JSONValue```, see [SwiftyJSON](https://github.com/lingoer/SwiftyJSON)***
108 |
109 | If you need something.Just specify it!
110 |
111 | ```Swift
112 | Request("https://www.google.com/images/srpr/logo11w.png").get{
113 | (response:GResponse) in
114 | let image:UIImage = response.object!
115 | }
116 | ```
117 | If you don't want to do that every time:
118 |
119 | ```Swift
120 | let client = GRequest("http://api.example.com")
121 | client.path("/path/to/resource").get{
122 | response in
123 | println(response.object) //Its JSON Now
124 | }
125 |
126 | ```
127 | ###Extensibility
128 | You can add your custom implementation of your Model deserialization.
129 |
130 | By extentions conform protocol: ```ResponseDeserialization```
131 |
132 | ```Swift
133 | extension CustomModel:ResponseDeserialization{
134 | class func convertFromData(data:NSData!) -> (CustomModel?, NSError?)
135 | }
136 |
137 | GRequest("http://api.example.com").get{
138 | response in
139 | let model:CustomModel! = response.object
140 | }
141 | ```
142 |
--------------------------------------------------------------------------------
/GRequest/GRequest.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GRequest.swift
3 | // GRequest
4 | //
5 | // Created by Ruoyu Fu on 14-7-1.
6 | // Copyright (c) 2014年 Roy Fu. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import UIKit
11 | import SwiftyJSON
12 |
13 |
14 | typealias Request = GRequest
15 |
16 |
17 | protocol ResponseDeserialization{
18 | class func convertFromData(data:NSData!) -> (Self?, NSError?)
19 | }
20 |
21 |
22 | class GRequest {
23 |
24 |
25 | var session: NSURLSession
26 | var config: NSURLSessionConfiguration {
27 | willSet{
28 | session = NSURLSession(configuration: newValue)
29 | }
30 | }
31 |
32 | init(_ urlString:String) {
33 | _baseURLString = urlString
34 | config = NSURLSessionConfiguration.defaultSessionConfiguration()
35 | session = NSURLSession.sharedSession()
36 | }
37 |
38 | func path(path: String) -> GRequest{
39 | let grequest = GRequest(_baseURLString)
40 |
41 | grequest._header = _header
42 | grequest._query = _query
43 | grequest._body = _body
44 | grequest._bodyTypeString = _bodyTypeString
45 |
46 | grequest._path = path
47 | return grequest
48 | }
49 |
50 | func query(query: Dictionary) -> GRequest{
51 | let grequest = GRequest(_baseURLString)
52 |
53 | grequest._path = _path
54 | grequest._header = _header
55 | grequest._body = _body
56 | grequest._bodyTypeString = _bodyTypeString
57 |
58 | grequest._query = query
59 | return grequest
60 | }
61 |
62 | func header(header: Dictionary) -> GRequest {
63 | let grequest = GRequest(_baseURLString)
64 |
65 | grequest._path = _path
66 | grequest._query = _query
67 | grequest._body = _body
68 | grequest._bodyTypeString = _bodyTypeString
69 |
70 | grequest._header = header
71 | return grequest
72 | }
73 |
74 | func formBody(body:Dictionary) -> GRequest{
75 | var urlEncString = ""
76 | var idx = 0
77 | for (key, value) in body{
78 | urlEncString = urlEncString + key.URLEncoded + "=" + value.URLEncoded
79 | if idx < body.count-1{
80 | urlEncString += "&"
81 | }
82 | idx++
83 | }
84 | let request = GRequest(_baseURLString)
85 | request._body = urlEncString.dataUsingEncoding(NSUTF8StringEncoding)
86 | request._bodyTypeString = "application/x-www-form-urlencoded"
87 |
88 | request._path = _path
89 | request._header = _header
90 | request._query = _query
91 |
92 | return request
93 | }
94 |
95 | func jsonBody(body:NSDictionary) -> GRequest{
96 | let request = GRequest(_baseURLString)
97 | request._body = JSONValue(body).rawJSONString.dataUsingEncoding(NSUTF8StringEncoding)
98 | request._bodyTypeString = "application/json"
99 |
100 | request._path = _path
101 | request._header = _header
102 | request._query = _query
103 |
104 | return request
105 | }
106 |
107 | func body(bodyData:NSData, typeString:String) -> GRequest{
108 | let grequest = GRequest(_baseURLString)
109 | grequest._body = bodyData
110 | grequest._bodyTypeString = typeString
111 |
112 | grequest._path = _path
113 | grequest._header = _header
114 | grequest._query = _query
115 |
116 | return grequest
117 | }
118 |
119 |
120 | func get(completion: (GResponse) -> ()){
121 | _sendRequest("GET", completion)
122 | }
123 |
124 | func get(completion: (GResponse) -> ()){
125 | _sendRequest("GET", completion)
126 | }
127 |
128 | func post(completion: (GResponse) -> ()){
129 | _sendRequest("POST", completion)
130 | }
131 |
132 | func post(completion: (GResponse) -> ()){
133 | _sendRequest("POST", completion)
134 | }
135 |
136 | func head(completion: (GResponse) -> ()){
137 | _sendRequest("HEAD", completion)
138 | }
139 |
140 | func head(completion: (GResponse) -> ()){
141 | _sendRequest("HEAD", completion)
142 | }
143 |
144 | func patch(completion: (GResponse) -> ()){
145 | _sendRequest("PATCH", completion)
146 | }
147 |
148 | func patch(completion: (GResponse) -> ()){
149 | _sendRequest("PATCH", completion)
150 | }
151 |
152 | func put(completion: (GResponse) -> ()){
153 | _sendRequest("PUT", completion)
154 | }
155 |
156 | func put(completion: (GResponse) -> ()){
157 | _sendRequest("PUT", completion)
158 | }
159 |
160 | func delete(completion: (GResponse) -> ()){
161 | _sendRequest("DELETE", completion)
162 | }
163 |
164 | func delete(completion: (GResponse) -> ()){
165 | _sendRequest("DELETE", completion)
166 | }
167 |
168 | func _sendRequest(method: String, completion: (GResponse) -> ()){
169 |
170 | var url:NSURL
171 |
172 | if let path = _path{
173 | var baseURL = NSURL(string:_baseURLString)
174 | url = NSURL(string: path, relativeToURL: baseURL)
175 | }else{
176 | url = NSURL(string:_baseURLString)
177 | }
178 |
179 | if let query = _query{
180 | var additionQueryString:String
181 | if url.query{
182 | additionQueryString = "&"
183 | }else{
184 | additionQueryString = "?"
185 | }
186 | var idx = 0
187 | for (key, value) in query{
188 | additionQueryString = additionQueryString + key.URLEncoded + "=" + value.URLEncoded
189 | if idx < query.count-1{
190 | additionQueryString += "&"
191 | }
192 | idx++
193 | }
194 | url = NSURL(string: url.absoluteString+additionQueryString)
195 | }
196 |
197 | var request = NSMutableURLRequest(URL: url)
198 |
199 | if let header = _header{
200 | for (field, value) in header{
201 | request.setValue(value, forHTTPHeaderField: field)
202 | }
203 | }
204 |
205 | if let body = _body{
206 | request.HTTPBody = body
207 | }
208 | if let bodyTypeString = _bodyTypeString{
209 | request.setValue(bodyTypeString, forHTTPHeaderField: "Content-Type")
210 | }
211 |
212 | request.HTTPMethod = method
213 |
214 | session.dataTaskWithRequest(request){
215 | data, response, error in
216 | let resp = GResponse(urlData: data, urlResponse: response, urlError: error)
217 | completion(resp)
218 | }.resume()
219 | }
220 |
221 | var _baseURLString: String
222 | var _path: String? = nil
223 | var _header: Dictionary? = nil
224 | var _query: Dictionary? = nil
225 | var _body: NSData? = nil
226 | var _bodyTypeString: String? = nil
227 |
228 | }
229 |
230 |
231 | struct GResponse:LogicValue{
232 |
233 | let object: T?
234 | let content: NSData?
235 | let statusCode: Int?
236 | let headers: NSDictionary?
237 | let MIMEType: String?
238 | let encoding: String?
239 |
240 | var string:String?{
241 | get{
242 | if encoding{
243 | let enc:NSString = encoding!
244 | let IANAEncoding:CFStringEncoding = CFStringConvertIANACharSetNameToEncoding(enc)
245 | if IANAEncoding != kCFStringEncodingInvalidId{
246 | let stringEncoding = CFStringConvertEncodingToNSStringEncoding(IANAEncoding);
247 | return NSString(data: content, encoding: stringEncoding)
248 | }
249 | }
250 | return nil
251 | }
252 | }
253 |
254 | let error:NSError?
255 |
256 |
257 | init(urlData: NSData!, urlResponse: NSURLResponse!, urlError: NSError!){
258 | content = urlData
259 |
260 | statusCode = (urlResponse as? NSHTTPURLResponse)?.statusCode
261 | headers = (urlResponse as? NSHTTPURLResponse)?.allHeaderFields
262 | MIMEType = (urlResponse as? NSHTTPURLResponse)?.MIMEType
263 | encoding = (urlResponse as? NSHTTPURLResponse)?.textEncodingName
264 |
265 | var desError:NSError?
266 | (object, desError) = T.convertFromData(urlData)
267 | if urlError{
268 | error = urlError
269 | }else if desError{
270 | error = desError
271 | } else {
272 | if let code = statusCode{
273 | if code >= 400 || code < 200{
274 | error = NSError(domain: "GRequestErrorDomain", code: code, userInfo: nil)
275 | }
276 | }
277 | }
278 | }
279 |
280 | func getLogicValue() -> Bool {
281 | if error{
282 | return false
283 | }
284 | return true
285 | }
286 | }
287 |
288 |
289 | extension JSONValue:ResponseDeserialization{
290 | static func convertFromData(data:NSData!) -> (JSONValue?, NSError?){
291 | let value = JSONValue(data)
292 | switch value{
293 | case .JInvalid(let error):
294 | return (value, error)
295 | default:
296 | return (value, nil)
297 | }
298 | }
299 | }
300 |
301 |
302 | extension NSData:ResponseDeserialization{
303 | class func convertFromData(data:NSData!) -> (NSData?, NSError?){
304 | return (data, nil)
305 | }
306 | }
307 |
308 |
309 | extension UIImage:ResponseDeserialization{
310 | class func convertFromData(data:NSData!) -> (UIImage?, NSError?){
311 | return (UIImage(data: data), nil)
312 | }
313 | }
314 |
315 |
316 | extension String{
317 |
318 | var URLEncoded:String{
319 | get{
320 | var raw: NSString = self
321 | var str = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,raw,"[].",":/?&=;+!@#$()',*",CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding))
322 | return str
323 | }
324 | }
325 |
326 | }
327 |
--------------------------------------------------------------------------------
/GRequest.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1738F87C1967ECC0006F5A69 /* GRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 1738F87B1967ECC0006F5A69 /* GRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
11 | 1738F8821967ECC0006F5A69 /* GRequest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1738F8761967ECC0006F5A69 /* GRequest.framework */; };
12 | 1738F8891967ECC0006F5A69 /* GRequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1738F8881967ECC0006F5A69 /* GRequestTests.swift */; };
13 | 1738F8931967ECEC006F5A69 /* GRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1738F8921967ECEC006F5A69 /* GRequest.swift */; };
14 | 1738F8941967ECEC006F5A69 /* GRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1738F8921967ECEC006F5A69 /* GRequest.swift */; };
15 | /* End PBXBuildFile section */
16 |
17 | /* Begin PBXContainerItemProxy section */
18 | 1738F8831967ECC0006F5A69 /* PBXContainerItemProxy */ = {
19 | isa = PBXContainerItemProxy;
20 | containerPortal = 1738F86D1967ECC0006F5A69 /* Project object */;
21 | proxyType = 1;
22 | remoteGlobalIDString = 1738F8751967ECC0006F5A69;
23 | remoteInfo = GRequest;
24 | };
25 | 1738F89C1967EDAE006F5A69 /* PBXContainerItemProxy */ = {
26 | isa = PBXContainerItemProxy;
27 | containerPortal = 1738F8951967EDAE006F5A69 /* SwiftyJSON.xcodeproj */;
28 | proxyType = 2;
29 | remoteGlobalIDString = 2E4FEFDB19575BE100351305;
30 | remoteInfo = SwiftyJSON;
31 | };
32 | 1738F89E1967EDAE006F5A69 /* PBXContainerItemProxy */ = {
33 | isa = PBXContainerItemProxy;
34 | containerPortal = 1738F8951967EDAE006F5A69 /* SwiftyJSON.xcodeproj */;
35 | proxyType = 2;
36 | remoteGlobalIDString = 2E4FEFE619575BE100351305;
37 | remoteInfo = SwiftyJSONTests;
38 | };
39 | 1738F8A01967EDAE006F5A69 /* PBXContainerItemProxy */ = {
40 | isa = PBXContainerItemProxy;
41 | containerPortal = 1738F8951967EDAE006F5A69 /* SwiftyJSON.xcodeproj */;
42 | proxyType = 2;
43 | remoteGlobalIDString = 2E4FF00219575CE600351305;
44 | remoteInfo = "SwiftyJSON-OSX";
45 | };
46 | 1738F8A21967EDAE006F5A69 /* PBXContainerItemProxy */ = {
47 | isa = PBXContainerItemProxy;
48 | containerPortal = 1738F8951967EDAE006F5A69 /* SwiftyJSON.xcodeproj */;
49 | proxyType = 2;
50 | remoteGlobalIDString = 2E4FF00C19575CE600351305;
51 | remoteInfo = "SwiftyJSON-OSXTests";
52 | };
53 | 1738F8A41967EDCB006F5A69 /* PBXContainerItemProxy */ = {
54 | isa = PBXContainerItemProxy;
55 | containerPortal = 1738F8951967EDAE006F5A69 /* SwiftyJSON.xcodeproj */;
56 | proxyType = 1;
57 | remoteGlobalIDString = 2E4FEFDA19575BE100351305;
58 | remoteInfo = SwiftyJSON;
59 | };
60 | /* End PBXContainerItemProxy section */
61 |
62 | /* Begin PBXFileReference section */
63 | 1738F8761967ECC0006F5A69 /* GRequest.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GRequest.framework; sourceTree = BUILT_PRODUCTS_DIR; };
64 | 1738F87A1967ECC0006F5A69 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
65 | 1738F87B1967ECC0006F5A69 /* GRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GRequest.h; sourceTree = ""; };
66 | 1738F8811967ECC0006F5A69 /* GRequestTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GRequestTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
67 | 1738F8871967ECC0006F5A69 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
68 | 1738F8881967ECC0006F5A69 /* GRequestTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GRequestTests.swift; sourceTree = ""; };
69 | 1738F8921967ECEC006F5A69 /* GRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GRequest.swift; sourceTree = ""; };
70 | 1738F8951967EDAE006F5A69 /* SwiftyJSON.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftyJSON.xcodeproj; path = SwiftyJSON/SwiftyJSON.xcodeproj; sourceTree = SOURCE_ROOT; };
71 | /* End PBXFileReference section */
72 |
73 | /* Begin PBXFrameworksBuildPhase section */
74 | 1738F8721967ECC0006F5A69 /* Frameworks */ = {
75 | isa = PBXFrameworksBuildPhase;
76 | buildActionMask = 2147483647;
77 | files = (
78 | );
79 | runOnlyForDeploymentPostprocessing = 0;
80 | };
81 | 1738F87E1967ECC0006F5A69 /* Frameworks */ = {
82 | isa = PBXFrameworksBuildPhase;
83 | buildActionMask = 2147483647;
84 | files = (
85 | 1738F8821967ECC0006F5A69 /* GRequest.framework in Frameworks */,
86 | );
87 | runOnlyForDeploymentPostprocessing = 0;
88 | };
89 | /* End PBXFrameworksBuildPhase section */
90 |
91 | /* Begin PBXGroup section */
92 | 1738F86C1967ECC0006F5A69 = {
93 | isa = PBXGroup;
94 | children = (
95 | 1738F8781967ECC0006F5A69 /* GRequest */,
96 | 1738F8851967ECC0006F5A69 /* GRequestTests */,
97 | 1738F8771967ECC0006F5A69 /* Products */,
98 | );
99 | sourceTree = "";
100 | };
101 | 1738F8771967ECC0006F5A69 /* Products */ = {
102 | isa = PBXGroup;
103 | children = (
104 | 1738F8761967ECC0006F5A69 /* GRequest.framework */,
105 | 1738F8811967ECC0006F5A69 /* GRequestTests.xctest */,
106 | );
107 | name = Products;
108 | sourceTree = "";
109 | };
110 | 1738F8781967ECC0006F5A69 /* GRequest */ = {
111 | isa = PBXGroup;
112 | children = (
113 | 1738F8951967EDAE006F5A69 /* SwiftyJSON.xcodeproj */,
114 | 1738F8921967ECEC006F5A69 /* GRequest.swift */,
115 | 1738F87B1967ECC0006F5A69 /* GRequest.h */,
116 | 1738F8791967ECC0006F5A69 /* Supporting Files */,
117 | );
118 | path = GRequest;
119 | sourceTree = "";
120 | };
121 | 1738F8791967ECC0006F5A69 /* Supporting Files */ = {
122 | isa = PBXGroup;
123 | children = (
124 | 1738F87A1967ECC0006F5A69 /* Info.plist */,
125 | );
126 | name = "Supporting Files";
127 | sourceTree = "";
128 | };
129 | 1738F8851967ECC0006F5A69 /* GRequestTests */ = {
130 | isa = PBXGroup;
131 | children = (
132 | 1738F8881967ECC0006F5A69 /* GRequestTests.swift */,
133 | 1738F8861967ECC0006F5A69 /* Supporting Files */,
134 | );
135 | path = GRequestTests;
136 | sourceTree = "";
137 | };
138 | 1738F8861967ECC0006F5A69 /* Supporting Files */ = {
139 | isa = PBXGroup;
140 | children = (
141 | 1738F8871967ECC0006F5A69 /* Info.plist */,
142 | );
143 | name = "Supporting Files";
144 | sourceTree = "";
145 | };
146 | 1738F8961967EDAE006F5A69 /* Products */ = {
147 | isa = PBXGroup;
148 | children = (
149 | 1738F89D1967EDAE006F5A69 /* SwiftyJSON.framework */,
150 | 1738F89F1967EDAE006F5A69 /* SwiftyJSONTests.xctest */,
151 | 1738F8A11967EDAE006F5A69 /* SwiftyJSON.framework */,
152 | 1738F8A31967EDAE006F5A69 /* SwiftyJSON-OSXTests.xctest */,
153 | );
154 | name = Products;
155 | sourceTree = "";
156 | };
157 | /* End PBXGroup section */
158 |
159 | /* Begin PBXHeadersBuildPhase section */
160 | 1738F8731967ECC0006F5A69 /* Headers */ = {
161 | isa = PBXHeadersBuildPhase;
162 | buildActionMask = 2147483647;
163 | files = (
164 | 1738F87C1967ECC0006F5A69 /* GRequest.h in Headers */,
165 | );
166 | runOnlyForDeploymentPostprocessing = 0;
167 | };
168 | /* End PBXHeadersBuildPhase section */
169 |
170 | /* Begin PBXNativeTarget section */
171 | 1738F8751967ECC0006F5A69 /* GRequest */ = {
172 | isa = PBXNativeTarget;
173 | buildConfigurationList = 1738F88C1967ECC0006F5A69 /* Build configuration list for PBXNativeTarget "GRequest" */;
174 | buildPhases = (
175 | 1738F8711967ECC0006F5A69 /* Sources */,
176 | 1738F8721967ECC0006F5A69 /* Frameworks */,
177 | 1738F8731967ECC0006F5A69 /* Headers */,
178 | 1738F8741967ECC0006F5A69 /* Resources */,
179 | );
180 | buildRules = (
181 | );
182 | dependencies = (
183 | 1738F8A51967EDCB006F5A69 /* PBXTargetDependency */,
184 | );
185 | name = GRequest;
186 | productName = GRequest;
187 | productReference = 1738F8761967ECC0006F5A69 /* GRequest.framework */;
188 | productType = "com.apple.product-type.framework";
189 | };
190 | 1738F8801967ECC0006F5A69 /* GRequestTests */ = {
191 | isa = PBXNativeTarget;
192 | buildConfigurationList = 1738F88F1967ECC0006F5A69 /* Build configuration list for PBXNativeTarget "GRequestTests" */;
193 | buildPhases = (
194 | 1738F87D1967ECC0006F5A69 /* Sources */,
195 | 1738F87E1967ECC0006F5A69 /* Frameworks */,
196 | 1738F87F1967ECC0006F5A69 /* Resources */,
197 | );
198 | buildRules = (
199 | );
200 | dependencies = (
201 | 1738F8841967ECC0006F5A69 /* PBXTargetDependency */,
202 | );
203 | name = GRequestTests;
204 | productName = GRequestTests;
205 | productReference = 1738F8811967ECC0006F5A69 /* GRequestTests.xctest */;
206 | productType = "com.apple.product-type.bundle.unit-test";
207 | };
208 | /* End PBXNativeTarget section */
209 |
210 | /* Begin PBXProject section */
211 | 1738F86D1967ECC0006F5A69 /* Project object */ = {
212 | isa = PBXProject;
213 | attributes = {
214 | LastUpgradeCheck = 0600;
215 | ORGANIZATIONNAME = "Roy Fu";
216 | TargetAttributes = {
217 | 1738F8751967ECC0006F5A69 = {
218 | CreatedOnToolsVersion = 6.0;
219 | };
220 | 1738F8801967ECC0006F5A69 = {
221 | CreatedOnToolsVersion = 6.0;
222 | TestTargetID = 1738F8751967ECC0006F5A69;
223 | };
224 | };
225 | };
226 | buildConfigurationList = 1738F8701967ECC0006F5A69 /* Build configuration list for PBXProject "GRequest" */;
227 | compatibilityVersion = "Xcode 3.2";
228 | developmentRegion = English;
229 | hasScannedForEncodings = 0;
230 | knownRegions = (
231 | en,
232 | );
233 | mainGroup = 1738F86C1967ECC0006F5A69;
234 | productRefGroup = 1738F8771967ECC0006F5A69 /* Products */;
235 | projectDirPath = "";
236 | projectReferences = (
237 | {
238 | ProductGroup = 1738F8961967EDAE006F5A69 /* Products */;
239 | ProjectRef = 1738F8951967EDAE006F5A69 /* SwiftyJSON.xcodeproj */;
240 | },
241 | );
242 | projectRoot = "";
243 | targets = (
244 | 1738F8751967ECC0006F5A69 /* GRequest */,
245 | 1738F8801967ECC0006F5A69 /* GRequestTests */,
246 | );
247 | };
248 | /* End PBXProject section */
249 |
250 | /* Begin PBXReferenceProxy section */
251 | 1738F89D1967EDAE006F5A69 /* SwiftyJSON.framework */ = {
252 | isa = PBXReferenceProxy;
253 | fileType = wrapper.framework;
254 | path = SwiftyJSON.framework;
255 | remoteRef = 1738F89C1967EDAE006F5A69 /* PBXContainerItemProxy */;
256 | sourceTree = BUILT_PRODUCTS_DIR;
257 | };
258 | 1738F89F1967EDAE006F5A69 /* SwiftyJSONTests.xctest */ = {
259 | isa = PBXReferenceProxy;
260 | fileType = wrapper.cfbundle;
261 | path = SwiftyJSONTests.xctest;
262 | remoteRef = 1738F89E1967EDAE006F5A69 /* PBXContainerItemProxy */;
263 | sourceTree = BUILT_PRODUCTS_DIR;
264 | };
265 | 1738F8A11967EDAE006F5A69 /* SwiftyJSON.framework */ = {
266 | isa = PBXReferenceProxy;
267 | fileType = wrapper.framework;
268 | path = SwiftyJSON.framework;
269 | remoteRef = 1738F8A01967EDAE006F5A69 /* PBXContainerItemProxy */;
270 | sourceTree = BUILT_PRODUCTS_DIR;
271 | };
272 | 1738F8A31967EDAE006F5A69 /* SwiftyJSON-OSXTests.xctest */ = {
273 | isa = PBXReferenceProxy;
274 | fileType = wrapper.cfbundle;
275 | path = "SwiftyJSON-OSXTests.xctest";
276 | remoteRef = 1738F8A21967EDAE006F5A69 /* PBXContainerItemProxy */;
277 | sourceTree = BUILT_PRODUCTS_DIR;
278 | };
279 | /* End PBXReferenceProxy section */
280 |
281 | /* Begin PBXResourcesBuildPhase section */
282 | 1738F8741967ECC0006F5A69 /* Resources */ = {
283 | isa = PBXResourcesBuildPhase;
284 | buildActionMask = 2147483647;
285 | files = (
286 | );
287 | runOnlyForDeploymentPostprocessing = 0;
288 | };
289 | 1738F87F1967ECC0006F5A69 /* Resources */ = {
290 | isa = PBXResourcesBuildPhase;
291 | buildActionMask = 2147483647;
292 | files = (
293 | );
294 | runOnlyForDeploymentPostprocessing = 0;
295 | };
296 | /* End PBXResourcesBuildPhase section */
297 |
298 | /* Begin PBXSourcesBuildPhase section */
299 | 1738F8711967ECC0006F5A69 /* Sources */ = {
300 | isa = PBXSourcesBuildPhase;
301 | buildActionMask = 2147483647;
302 | files = (
303 | 1738F8931967ECEC006F5A69 /* GRequest.swift in Sources */,
304 | );
305 | runOnlyForDeploymentPostprocessing = 0;
306 | };
307 | 1738F87D1967ECC0006F5A69 /* Sources */ = {
308 | isa = PBXSourcesBuildPhase;
309 | buildActionMask = 2147483647;
310 | files = (
311 | 1738F8891967ECC0006F5A69 /* GRequestTests.swift in Sources */,
312 | 1738F8941967ECEC006F5A69 /* GRequest.swift in Sources */,
313 | );
314 | runOnlyForDeploymentPostprocessing = 0;
315 | };
316 | /* End PBXSourcesBuildPhase section */
317 |
318 | /* Begin PBXTargetDependency section */
319 | 1738F8841967ECC0006F5A69 /* PBXTargetDependency */ = {
320 | isa = PBXTargetDependency;
321 | target = 1738F8751967ECC0006F5A69 /* GRequest */;
322 | targetProxy = 1738F8831967ECC0006F5A69 /* PBXContainerItemProxy */;
323 | };
324 | 1738F8A51967EDCB006F5A69 /* PBXTargetDependency */ = {
325 | isa = PBXTargetDependency;
326 | name = SwiftyJSON;
327 | targetProxy = 1738F8A41967EDCB006F5A69 /* PBXContainerItemProxy */;
328 | };
329 | /* End PBXTargetDependency section */
330 |
331 | /* Begin XCBuildConfiguration section */
332 | 1738F88A1967ECC0006F5A69 /* Debug */ = {
333 | isa = XCBuildConfiguration;
334 | buildSettings = {
335 | ALWAYS_SEARCH_USER_PATHS = NO;
336 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
337 | CLANG_CXX_LIBRARY = "libc++";
338 | CLANG_ENABLE_MODULES = YES;
339 | CLANG_ENABLE_OBJC_ARC = YES;
340 | CLANG_WARN_BOOL_CONVERSION = YES;
341 | CLANG_WARN_CONSTANT_CONVERSION = YES;
342 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
343 | CLANG_WARN_EMPTY_BODY = YES;
344 | CLANG_WARN_ENUM_CONVERSION = YES;
345 | CLANG_WARN_INT_CONVERSION = YES;
346 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
347 | CLANG_WARN_UNREACHABLE_CODE = YES;
348 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
349 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
350 | COPY_PHASE_STRIP = NO;
351 | CURRENT_PROJECT_VERSION = 1;
352 | ENABLE_STRICT_OBJC_MSGSEND = YES;
353 | GCC_C_LANGUAGE_STANDARD = gnu99;
354 | GCC_DYNAMIC_NO_PIC = NO;
355 | GCC_OPTIMIZATION_LEVEL = 0;
356 | GCC_PREPROCESSOR_DEFINITIONS = (
357 | "DEBUG=1",
358 | "$(inherited)",
359 | );
360 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
361 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
362 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
363 | GCC_WARN_UNDECLARED_SELECTOR = YES;
364 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
365 | GCC_WARN_UNUSED_FUNCTION = YES;
366 | GCC_WARN_UNUSED_VARIABLE = YES;
367 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
368 | METAL_ENABLE_DEBUG_INFO = YES;
369 | ONLY_ACTIVE_ARCH = YES;
370 | SDKROOT = iphoneos;
371 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
372 | TARGETED_DEVICE_FAMILY = "1,2";
373 | VERSIONING_SYSTEM = "apple-generic";
374 | VERSION_INFO_PREFIX = "";
375 | };
376 | name = Debug;
377 | };
378 | 1738F88B1967ECC0006F5A69 /* Release */ = {
379 | isa = XCBuildConfiguration;
380 | buildSettings = {
381 | ALWAYS_SEARCH_USER_PATHS = NO;
382 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
383 | CLANG_CXX_LIBRARY = "libc++";
384 | CLANG_ENABLE_MODULES = YES;
385 | CLANG_ENABLE_OBJC_ARC = YES;
386 | CLANG_WARN_BOOL_CONVERSION = YES;
387 | CLANG_WARN_CONSTANT_CONVERSION = YES;
388 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
389 | CLANG_WARN_EMPTY_BODY = YES;
390 | CLANG_WARN_ENUM_CONVERSION = YES;
391 | CLANG_WARN_INT_CONVERSION = YES;
392 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
393 | CLANG_WARN_UNREACHABLE_CODE = YES;
394 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
395 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
396 | COPY_PHASE_STRIP = YES;
397 | CURRENT_PROJECT_VERSION = 1;
398 | ENABLE_NS_ASSERTIONS = NO;
399 | ENABLE_STRICT_OBJC_MSGSEND = YES;
400 | GCC_C_LANGUAGE_STANDARD = gnu99;
401 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
402 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
403 | GCC_WARN_UNDECLARED_SELECTOR = YES;
404 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
405 | GCC_WARN_UNUSED_FUNCTION = YES;
406 | GCC_WARN_UNUSED_VARIABLE = YES;
407 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
408 | METAL_ENABLE_DEBUG_INFO = NO;
409 | SDKROOT = iphoneos;
410 | TARGETED_DEVICE_FAMILY = "1,2";
411 | VALIDATE_PRODUCT = YES;
412 | VERSIONING_SYSTEM = "apple-generic";
413 | VERSION_INFO_PREFIX = "";
414 | };
415 | name = Release;
416 | };
417 | 1738F88D1967ECC0006F5A69 /* Debug */ = {
418 | isa = XCBuildConfiguration;
419 | buildSettings = {
420 | DEFINES_MODULE = YES;
421 | DYLIB_COMPATIBILITY_VERSION = 1;
422 | DYLIB_CURRENT_VERSION = 1;
423 | DYLIB_INSTALL_NAME_BASE = "@rpath";
424 | INFOPLIST_FILE = GRequest/Info.plist;
425 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
426 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
427 | PRODUCT_NAME = "$(TARGET_NAME)";
428 | SKIP_INSTALL = YES;
429 | };
430 | name = Debug;
431 | };
432 | 1738F88E1967ECC0006F5A69 /* Release */ = {
433 | isa = XCBuildConfiguration;
434 | buildSettings = {
435 | DEFINES_MODULE = YES;
436 | DYLIB_COMPATIBILITY_VERSION = 1;
437 | DYLIB_CURRENT_VERSION = 1;
438 | DYLIB_INSTALL_NAME_BASE = "@rpath";
439 | INFOPLIST_FILE = GRequest/Info.plist;
440 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
441 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
442 | PRODUCT_NAME = "$(TARGET_NAME)";
443 | SKIP_INSTALL = YES;
444 | };
445 | name = Release;
446 | };
447 | 1738F8901967ECC0006F5A69 /* Debug */ = {
448 | isa = XCBuildConfiguration;
449 | buildSettings = {
450 | FRAMEWORK_SEARCH_PATHS = (
451 | "$(SDKROOT)/Developer/Library/Frameworks",
452 | "$(inherited)",
453 | );
454 | GCC_PREPROCESSOR_DEFINITIONS = (
455 | "DEBUG=1",
456 | "$(inherited)",
457 | );
458 | INFOPLIST_FILE = GRequestTests/Info.plist;
459 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
460 | METAL_ENABLE_DEBUG_INFO = YES;
461 | PRODUCT_NAME = "$(TARGET_NAME)";
462 | };
463 | name = Debug;
464 | };
465 | 1738F8911967ECC0006F5A69 /* Release */ = {
466 | isa = XCBuildConfiguration;
467 | buildSettings = {
468 | FRAMEWORK_SEARCH_PATHS = (
469 | "$(SDKROOT)/Developer/Library/Frameworks",
470 | "$(inherited)",
471 | );
472 | INFOPLIST_FILE = GRequestTests/Info.plist;
473 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
474 | METAL_ENABLE_DEBUG_INFO = NO;
475 | PRODUCT_NAME = "$(TARGET_NAME)";
476 | };
477 | name = Release;
478 | };
479 | /* End XCBuildConfiguration section */
480 |
481 | /* Begin XCConfigurationList section */
482 | 1738F8701967ECC0006F5A69 /* Build configuration list for PBXProject "GRequest" */ = {
483 | isa = XCConfigurationList;
484 | buildConfigurations = (
485 | 1738F88A1967ECC0006F5A69 /* Debug */,
486 | 1738F88B1967ECC0006F5A69 /* Release */,
487 | );
488 | defaultConfigurationIsVisible = 0;
489 | defaultConfigurationName = Release;
490 | };
491 | 1738F88C1967ECC0006F5A69 /* Build configuration list for PBXNativeTarget "GRequest" */ = {
492 | isa = XCConfigurationList;
493 | buildConfigurations = (
494 | 1738F88D1967ECC0006F5A69 /* Debug */,
495 | 1738F88E1967ECC0006F5A69 /* Release */,
496 | );
497 | defaultConfigurationIsVisible = 0;
498 | defaultConfigurationName = Release;
499 | };
500 | 1738F88F1967ECC0006F5A69 /* Build configuration list for PBXNativeTarget "GRequestTests" */ = {
501 | isa = XCConfigurationList;
502 | buildConfigurations = (
503 | 1738F8901967ECC0006F5A69 /* Debug */,
504 | 1738F8911967ECC0006F5A69 /* Release */,
505 | );
506 | defaultConfigurationIsVisible = 0;
507 | defaultConfigurationName = Release;
508 | };
509 | /* End XCConfigurationList section */
510 | };
511 | rootObject = 1738F86D1967ECC0006F5A69 /* Project object */;
512 | }
513 |
--------------------------------------------------------------------------------