Skip to content
This repository has been archived by the owner on Apr 5, 2020. It is now read-only.

Issue when compiling under Swift 4? #13

Closed
TempaGoGo opened this issue Oct 27, 2017 · 2 comments
Closed

Issue when compiling under Swift 4? #13

TempaGoGo opened this issue Oct 27, 2017 · 2 comments

Comments

@TempaGoGo
Copy link

Guys, When I try to complete a project under Swift 4, using S3SignerAWS, Xcode suggests a code change in the following function:

internal func canonicalHeaders(
	headers: [String: String])
	-> String
{
		let headerList = Array(headers.keys)
			.map { "\($0.lowercased()):\(headers[$0]!)" }
			.filter { $0 != "authorization" }
			.sorted { $0.localizedCompare($1) == ComparisonResult.orderedAscending }
			.joined(separator: "\n")
			.appending("\n")
		
		return headerList

}

to

internal func canonicalHeaders(
headers: [String: String])
-> String
{
let headerList = Array(headers.keys)
.map { "($0.lowercased()):(headers[$0]!)" }
.filter { $0 != "authorization" }
.sorted { $0.0.localizedCompare($0.1) == ComparisonResult.orderedAscending }
.joined(separator: "\n")
.appending("\n")

		return headerList
}

This then causes other syntax issues.

Kind regards, Phil

@JustinM1
Copy link
Owner

Hey Phil,

Just updated project for swift 4 compatibility. You should be good to go.

Justin

@TempaGoGo
Copy link
Author

TempaGoGo commented Oct 27, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant