Skip to content

Commit 23696c5

Browse files
committed
Merge pull request #2210 from svenluzar/master
ApiClient Bugfix: containsString removed to support iOS 7
2 parents 0520e68 + 4baa7c0 commit 23696c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/swagger-codegen/src/main/resources/objc/ApiClient-body.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ static void (^reachabilityChangeBlock)(int);
136136
NSMutableArray *lowerAccepts = [[NSMutableArray alloc] initWithCapacity:[accepts count]];
137137
for (NSString *string in accepts) {
138138
NSString * lowerAccept = [string lowercaseString];
139-
if ([lowerAccept containsString:@"application/json"]) {
139+
// use rangeOfString instead of containsString for iOS 7 support
140+
if ([lowerAccept rangeOfString:@"application/json"].location != NSNotFound) {
140141
return @"application/json";
141142
}
142143
[lowerAccepts addObject:lowerAccept];

0 commit comments

Comments
 (0)