From f2ebb08b33dd906309bbdf73e6c40f56429e7d30 Mon Sep 17 00:00:00 2001 From: Jack Wink Date: Fri, 29 Jul 2016 21:57:08 -0700 Subject: [PATCH] [Swift] Use the latest Alamofire (3.4.1) This commit updates the Swift client templates to be compatible with the latest version of Alamofire. It bumps the dependency version in the podspec and names the argument when calling `responseData`. We found that XCode was having trouble with the overloaded methods and needed the named argument for hinting. --- .../src/main/resources/swift/AlamofireImplementations.mustache | 2 +- .../swagger-codegen/src/main/resources/swift/Podspec.mustache | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/swift/AlamofireImplementations.mustache b/modules/swagger-codegen/src/main/resources/swift/AlamofireImplementations.mustache index cabf67567b5..baa6d8aa72a 100644 --- a/modules/swagger-codegen/src/main/resources/swift/AlamofireImplementations.mustache +++ b/modules/swagger-codegen/src/main/resources/swift/AlamofireImplementations.mustache @@ -90,7 +90,7 @@ class AlamofireRequestBuilder: RequestBuilder { switch T.self { case is NSData.Type: - validatedRequest.responseData({ (dataResponse) in + validatedRequest.responseData(completionHandler: { (dataResponse) in cleanupRequest() if (dataResponse.result.isFailure) { diff --git a/modules/swagger-codegen/src/main/resources/swift/Podspec.mustache b/modules/swagger-codegen/src/main/resources/swift/Podspec.mustache index 2289e7f6f01..f893182d9ab 100644 --- a/modules/swagger-codegen/src/main/resources/swift/Podspec.mustache +++ b/modules/swagger-codegen/src/main/resources/swift/Podspec.mustache @@ -16,5 +16,5 @@ Pod::Spec.new do |s| s.documentation_url = '{{podDocumentationURL}}'{{/podDocumentationURL}} s.source_files = '{{projectName}}/Classes/Swaggers/**/*.swift'{{#usePromiseKit}} s.dependency 'PromiseKit', '~> 3.1.1'{{/usePromiseKit}} - s.dependency 'Alamofire', '~> 3.1.5' + s.dependency 'Alamofire', '~> 3.4.1' end