Browse Source

Merge pull request #707 from mishagray/xcode7b6

Christian Noon 10 years ago
parent
commit
a90f2e59d4

+ 1 - 1
Example/DetailViewController.swift

@@ -148,7 +148,7 @@ extension DetailViewController {
         switch Sections(rawValue: indexPath.section)! {
         case .Headers:
             let cell = tableView.dequeueReusableCellWithIdentifier("Header")!
-            let field = headers.keys.array.sort(<)[indexPath.row]
+            let field = headers.keys.sort(<)[indexPath.row]
             let value = headers[field]
 
             cell.textLabel?.text = field

+ 1 - 1
Source/Manager.swift

@@ -58,7 +58,7 @@ public class Manager {
                 }
             }
 
-            return ",".join(components)
+            return components.joinWithSeparator(",")
         }()
 
         // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3

+ 1 - 1
Source/ParameterEncoding.swift

@@ -88,7 +88,7 @@ public enum ParameterEncoding {
                     components += queryComponents(key, value)
                 }
 
-                return "&".join(components.map { "\($0)=\($1)" } as [String])
+                return (components.map { "\($0)=\($1)" } as [String]).joinWithSeparator("&")
             }
 
             func encodesParametersInURL(method: Method) -> Bool {

+ 3 - 3
Source/Request.swift

@@ -444,7 +444,7 @@ extension Request: CustomStringConvertible {
             components.append("(\(response.statusCode))")
         }
 
-        return " ".join(components)
+        return components.joinWithSeparator(" ")
     }
 }
 
@@ -473,7 +473,7 @@ extension Request: CustomDebugStringConvertible {
                 authenticationMethod: NSURLAuthenticationMethodHTTPBasic
             )
 
-            if let credentials = credentialStorage.credentialsForProtectionSpace(protectionSpace)?.values.array {
+            if let credentials = credentialStorage.credentialsForProtectionSpace(protectionSpace)?.values {
                 for credential in credentials {
                     components.append("-u \(credential.user!):\(credential.password!)")
                 }
@@ -526,7 +526,7 @@ extension Request: CustomDebugStringConvertible {
 
         components.append("\"\(URL!.absoluteString)\"")
 
-        return " \\\n\t".join(components)
+        return components.joinWithSeparator(" \\\n\t")
     }
 
     /// The textual representation used when written to an output stream, in the form of a cURL command.

+ 1 - 1
Tests/ParameterEncodingTests.swift

@@ -322,7 +322,7 @@ class URLParameterEncodingTestCase: ParameterEncodingTestCase {
             "japanese=%E6%97%A5%E6%9C%AC%E8%AA%9E"
         ]
 
-        let expectedQuery = "&".join(expectedParameterValues)
+        let expectedQuery = expectedParameterValues.joinWithSeparator("&")
         XCTAssertEqual(URLRequest.URL?.query ?? "", expectedQuery, "query is incorrect")
     }
 

+ 2 - 2
Tests/UploadTests.swift

@@ -594,7 +594,7 @@ class UploadMultipartFormDataTestCase: BaseTestCase {
                 loremValues.append("Lorem ipsum dolor sit amet, consectetur adipiscing elit.")
             }
 
-            return " ".join(loremValues).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
+            return loremValues.joinWithSeparator(" ").dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
         }()
         let loremData2: NSData = {
             var loremValues: [String] = []
@@ -602,7 +602,7 @@ class UploadMultipartFormDataTestCase: BaseTestCase {
                 loremValues.append("Lorem ipsum dolor sit amet, nam no graeco recusabo appellantur.")
             }
 
-            return " ".join(loremValues).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
+            return loremValues.joinWithSeparator(" ").dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
         }()
 
         let expectation = expectationWithDescription("multipart form data upload should succeed")