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 2.0 #36

Closed wvteijlingen closed 8 years ago

kurko commented 9 years ago

:tada: :tada: :tada: :tada: :tada:

kurko commented 9 years ago

I'm getting the following error when trying to compile my app with this branch: https://gist.github.com/kurko/560ccaf4df5207f10193

Do you have any idea what that is? Perhaps related to ResourceProtocol?

wvteijlingen commented 9 years ago

Are you using Cocoapods or Carthage here?

kurko commented 9 years ago

Cocoapods.

wvteijlingen commented 9 years ago

It seems to be some kind of problem with the Result dependency that BrightFutures needs. In any case, I removed the Future extensions to slim down this library.

kurko commented 9 years ago

@wvteijlingen :heart: gonna retry tonight.

kurko commented 9 years ago

@wvteijlingen :heart: gonna retry tonight.

EDIT: YAY! It worked! I was able to get my application to run in Swift 2 with Xcode 7 and this branch.

Only problem I have now is I am getting an error with spine.HTTPClient. I can't set authorization headers.

screen shot 2015-10-23 at 6 41 04 pm
wvteijlingen commented 9 years ago

This should be fixed now. The easiest way to set headers would be as follows though, given that you are using the default HTTPClient.

(spine.networkClient as! HTTPClient).setHeader("header", to: "value")
kurko commented 9 years ago

Works great! This was the last pending thing. I'll continue working on Xcode7/Swift2 now until I find something else :D