wvteijlingen / Spine

A Swift library for working with JSON:API APIs. It supports mapping to custom model classes, fetching, advanced querying, linking and persisting.
MIT License
266 stars 109 forks source link

Swift 3 support #91

Closed invliD closed 7 years ago

Blackjacx commented 8 years ago

We want too 👍

Blackjacx commented 7 years ago

Do you have a plan when you migrate your code to Swift 3 or Swift 2.3? Since Xcode 8 is out now we would like to switch as fast as possible.

wvteijlingen commented 7 years ago

Check out the swift-3.0 branch: https://github.com/wvteijlingen/Spine/tree/swift-3.0

waritsan commented 7 years ago

swift-3.0 branch does not work for me. Here are a few points to look at

  1. It does not work with Cocoapod. There's a typo in podspec #107
  2. SwiftyJSON dependency is not swift 3 compatible.
  3. After manually fixing the above issues, there are syntax errors so I use the auto conversion. I was able to build successfully but I got a runtime error.

Has anyone got it to work? Please advise.

wvteijlingen commented 7 years ago

I updated the Podspec to remove the extraneous apostrophe. I'm no Cocoapods user but I believe you need to point to the SwiftyJSON swift 3 branch in your own Podfile.

Regarding the syntax issues and runtime error, could you create a PR for them or let me know which issues there are? Thanks!

Blackjacx commented 7 years ago

Hey,

to use the Swift 3 branch as dependency for your POD you need to specify that in the podspec of Spine in its Swift 3 branch. With Cocoapods always the pod owner is responsible for setting the correct dependencies.

wvteijlingen commented 7 years ago

If I am not mistaken Cocoapods does not allow you specify unreleased pod versions in a Podspec. See https://github.com/cocoapods/cocoapods/issues/3901#issuecomment-227291635. Again, I'm not a Cocoapods user so if you have a fix for this, feel free to create a PR.

waritsan commented 7 years ago

Right, you can't specify a dependency as git repo in podspec. In that case you might want to update the installation guide for cocoapod with the following line. It works for me.

pod 'SwiftyJSON', :git => 'https://github.com/appsailor/SwiftyJSON.git', :branch => 'swift3'

Thanks,

Blackjacx commented 7 years ago

Ahhh nice thank you!