New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Compatibility with Swift 3.0 (up to Xcode 8 GM) #267
Conversation
I needed to make additional manual migration changes for Xcode 8, beta 6, but when trying to authenticate to Yelp, I get INVALID_SIGNATURE consistently and despite numerous code reviews. Using the Swift 2.0 version of OAuthSwift with Xcode 7.3 however, it works fine. Any ideas? |
@dongri, @rvangraan, can either of you double check |
I have given up on OAuthSwift for Swift 3 and using simple URLRequest and URLSession with dataTasks to authenticate to Yelp. I was only using maybe 1% of the capability of OAuthSwift and was getting tired of fixing the code for every new beta of Xcode 8. Sent from my iPad Pro
|
@cambuilt swift3 is in beta, xcode is in beta, what do you expect... @nighthawk I make a swift3.0 branch today. There is some bug in unit test but all compile |
Tests are compiling again and all but |
Small adjustment to OAuthSwiftHTTPRequest.start() to pass on HTTP response error code rather than using default value of -1
@@ -160,17 +163,16 @@ open class OAuthSwiftHTTPRequest: NSObject, URLSessionDelegate, OAuthSwiftReques | |||
} | |||
} | |||
} else { | |||
localizedDescription = OAuthSwiftHTTPRequest.descriptionForHTTPStatus(self.response.statusCode, responseString: String(data: self.responseData as Data, encoding: self.dataEncoding)!) | |||
errorCode = httpResponse.statusCode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line fixes testExpire
as otherwise -1
would be returned.
(Don't get confused by GitHub showing that localizedDescription
got removed, it just moved down one line.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that was fixed in master branch
All tests are succeeding now. |
I thought a fork would at least build, but let me know if that should not be expected, since I am relatively new to Github.
|
@cambuilt, this pull request is marked as WIP, which stands for Work in Progress. For you issue, it would be much appreciated if you can provide a test case to |
Not sure how I can do that without giving you my client id and secret, in this case.
|
Wouldn't the oauth_timestamp have to be identical for both to get a valid result?
|
A fixed timestamp is fine for the tests - check out the other tests for comparison. |
Thanks.
|
I think some function renaming is needed to follow the new guidelines by omitting needless words.
|
ci you apply this fix has been successful.
Very Thanks. This fixes When you are merge. But probably OAuthSwiftTVOS and OAuthSwiftWatchOS requires a convert. OAuthSwiftTVOS
OAuthSwiftWatchOS
|
Not a real convert, just open the targets > build settings look for “Use Legacy Swift Language Version”. Changer "Unspecified" to "No" |
old comment
|
@phimage May I ask you to rebase |
If @nighthawk can squash its commits until 3 days I will merge into master branch ( and do some change function naming, etc...). |
This includes both changes suggested by Xcode's migration tool as well as manual fixing of the issues that Xcode couldn't migrate.
Action list:
Int+OAuthSwift.swift