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

Bool instead of NSNumber #51

Closed xamoom-raphael closed 8 years ago

xamoom-raphael commented 8 years ago

Hey, I'm just started using Spine and I wonder if it is possible to use native Bool instead of NSNumber?

ATM it looks like this:

  dynamic var demo: NSNumber?
xamoom-raphael commented 8 years ago

I'm very sorry, I made a mistake in my api, so I did not receive the complete json. It's no problem to map a Bool like:

var demo : Bool = false

I close this issue.

wvteijlingen commented 8 years ago

You can indeed use value types like Bool, Int, Float etc. The caveat though is that you cannot mark them as optionals. I don't know why exactly, but it doesn't work with Key Value Coding. Also, dynamic is not needed, the README is out of date.