From 4baa7c01b0b471d6491faa26491310b9ab01f0ec Mon Sep 17 00:00:00 2001 From: Sven Luzar Date: Mon, 22 Feb 2016 13:39:21 +0100 Subject: [PATCH] ApiClient Bugfix: containsString removed to support iOS 7 --- .../src/main/resources/objc/ApiClient-body.mustache | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache b/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache index a12b4bd224a..2fcd91ac323 100644 --- a/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache @@ -136,7 +136,8 @@ static void (^reachabilityChangeBlock)(int); NSMutableArray *lowerAccepts = [[NSMutableArray alloc] initWithCapacity:[accepts count]]; for (NSString *string in accepts) { NSString * lowerAccept = [string lowercaseString]; - if ([lowerAccept containsString:@"application/json"]) { + // use rangeOfString instead of containsString for iOS 7 support + if ([lowerAccept rangeOfString:@"application/json"].location != NSNotFound) { return @"application/json"; } [lowerAccepts addObject:lowerAccept];