Skip to content

Commit 7745d3b

Browse files
committed
Update: Xcode 6.1 & Alamofire 1.1.0 & SwiftyJSON 2.1.0
1 parent ebb6af8 commit 7745d3b

4 files changed

Lines changed: 11 additions & 13 deletions

File tree

Alamofire-SwiftyJSON.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@
390390
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
391391
GCC_WARN_UNUSED_FUNCTION = YES;
392392
GCC_WARN_UNUSED_VARIABLE = YES;
393-
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
393+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
394394
MTL_ENABLE_DEBUG_INFO = YES;
395395
ONLY_ACTIVE_ARCH = YES;
396396
SDKROOT = iphoneos;
@@ -430,7 +430,7 @@
430430
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
431431
GCC_WARN_UNUSED_FUNCTION = YES;
432432
GCC_WARN_UNUSED_VARIABLE = YES;
433-
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
433+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
434434
MTL_ENABLE_DEBUG_INFO = NO;
435435
SDKROOT = iphoneos;
436436
TARGETED_DEVICE_FAMILY = "1,2";

Source/Alamofire-SwiftyJSON.swift

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import SwiftyJSON
1313

1414
// MARK: - Request for Swift JSON
1515

16-
extension Alamofire.Request {
16+
extension Request {
1717

1818
/**
1919
Adds a handler to be called once the request has finished.
@@ -35,19 +35,17 @@ extension Alamofire.Request {
3535

3636
:returns: The request.
3737
*/
38-
public func responseSwiftyJSON(queue: dispatch_queue_t? = nil, options: NSJSONReadingOptions = .AllowFragments, completionHandler: (NSURLRequest, NSHTTPURLResponse?, SwiftyJSON.JSON, NSError?) -> Void) -> Self {
38+
public func responseSwiftyJSON(queue: dispatch_queue_t? = nil, options: NSJSONReadingOptions = .AllowFragments, completionHandler: (NSURLRequest, NSHTTPURLResponse?, JSON, NSError?) -> Void) -> Self {
3939

40-
return response(queue: queue, serializer: Alamofire.Request.JSONResponseSerializer(options: options), completionHandler: { (request, response, object, error) -> Void in
40+
return response(queue: queue, serializer: Request.JSONResponseSerializer(options: options), completionHandler: { (request, response, object, error) -> Void in
4141

4242
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), {
4343

44-
var responseJSON: SwiftyJSON.JSON
45-
if error != nil {
46-
responseJSON = SwiftyJSON.JSON.nullJSON
47-
} else if object != nil {
48-
responseJSON = SwiftyJSON.JSON(object!)
44+
var responseJSON: JSON
45+
if error != nil || object == nil{
46+
responseJSON = JSON.nullJSON
4947
} else {
50-
responseJSON = SwiftyJSON.JSON.nullJSON
48+
responseJSON = SwiftyJSON.JSON(object!)
5149
}
5250

5351
dispatch_async(queue ?? dispatch_get_main_queue(), {

0 commit comments

Comments
 (0)