提交 a90f2e59 编写于 作者: C Christian Noon

Merge pull request #707 from mishagray/xcode7b6

......@@ -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
......
......@@ -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
......
......@@ -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 {
......
......@@ -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.
......
......@@ -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")
}
......
......@@ -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")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册