Skip to content
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

Xcode 7 - Swift 2.0 #130

Closed
mpclarkson opened this issue Jul 6, 2015 · 18 comments
Closed

Xcode 7 - Swift 2.0 #130

mpclarkson opened this issue Jul 6, 2015 · 18 comments

Comments

@mpclarkson
Copy link

I've forked this great library and I'm working on a basic swift 2.0 compatibility branch here https://github.com/mpclarkson/SwiftHTTP/tree/swift-2

It's pretty rudimentary at the moment (e.g. no guards, throws etc) but once I have my project running in swift 2 and can test it properly I'll submit a pull request if you want?

@daltoniam
Copy link
Owner

Awesome, thanks! Yeah I haven't had time to start working on a Swift 2.0 branch yet, so a PR would be greatly appreciated.

Also if you are interested, I setup a slack team to discuss the different OSS projects (SwiftHTTP, JSONJoy, Starscream, etc). Let me know if you would like an invite.

@mpclarkson
Copy link
Author

That would be great my slack email is matt AT hilenium.com

@SF-Simon
Copy link

SF-Simon commented Jul 8, 2015

THX! This is really what I need

@mpclarkson
Copy link
Author

@feiyun-li It seems to be working ok but let me know if you have any problems.

@SF-Simon
Copy link

Xcode 7 beta 4, a new syntax changes, I waited for this update

@anderoonies
Copy link

any news on a PR? thanks again @mpclarkson for doing this 🙏

@mpclarkson
Copy link
Author

Ah, sorry I thought I'd already submitted a PR but hadn't. Just done so. I haven't had any time to work on it further as I've been working on backend stuff for the last month or so.

@codecowboy
Copy link

@mpclarkson is this PR merged now? Also, will this work for an OSX command line Tool or only iOS?

@acmacalister
Copy link
Collaborator

@codecowboy we aren't merging the swift 2 branches until Xcode 7/Swift 2 is out of beta. Until then, just use the swift 2 branch.

@codecowboy
Copy link

I tried with the swift 2 branch but get:

HTTPSecurity.swift:124:22: Cannot invoke 'SecPolicyCreateSSL' with an argument list of type '(Bool, String?)

Think I will just use NSURL :(

@SebastianOsinski
Copy link

@codecowboy Update Xcode 7 to the latest beta release. There was small change in the API - previously this initializer took Int and String? as arguments, in Xcode 7b5 it takes Bool and String?.

@mpclarkson
Copy link
Author

Yep, update Xcode and it'll be fine. Can't wait for some stability!

@codecowboy
Copy link

Thanks all. I fudged a fix as I didn't want to update to XCode beta 5 just yet (I'm following a course which requires an earlier version)

policy = SecPolicyCreateSSL(1, domain as! CFString)

@daltoniam
Copy link
Owner

For reference:

This will become the Swift 2 proper and is a big refactor for Swift 2. This will be merged into master.
https://github.com/daltoniam/SwiftHTTP/tree/swift-2

This is the backwards compatibility branch with minimal changes needed to support Swift 2.
https://github.com/daltoniam/SwiftHTTP/tree/swift-2-bc

Any questions let me know.

@UtkuDalmaz
Copy link

I am getting "Initialiser for conditional binding must have optional type not NSURL" error at
if let newPath = NSURL(fileURLWithPath: "(path)/(fileName)") {
When i try to download... (XCODE 7.1)

@JeffGos
Copy link

JeffGos commented Sep 17, 2015

Any news on merging the swift 2 branch into master?

@daltoniam
Copy link
Owner

Swift 2 branch has been merged into master!

@JeffGos
Copy link

JeffGos commented Sep 17, 2015

Thanks. Could you update the podfile too please

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

No branches or pull requests

9 participants