TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jun 2016 |
SPMSupports SPM | ✗ |
Maintained by Francesco Colleoni - nearit.com, Alex Corlatti, Vincenzo.
An utility library for iOS which implements typed queries over Swift dictionaries - includes wrapper classes for JSON API resource objects (single objects and collections)
This library exposes two core objects:
JSON
APIResource
The JSON
class exposes “search” methods similar to NSDictionary
’s valueForKeyPath(_:)
, but converts results into objects with a known type:
String?
Int?
Float?
Double?
Bool?
Bool
(evaluated against Int values)Bool
(compared to String values)[String: AnyObject]
?[String]
?[Int]
? [Float]
?[Bool]
?[AnyObject]
?[
[String: AnyObject]
]
?The APIResource
class inherits from APIObjectBase
class and represents a JSON API resource object. Instances of such class can be created with a JSON instance or an instance of NSData
.
The dictionary used to instantiate APIResource
must be a [String: AnyObject]
dictionary whose structure conforms to the JSON API standard.
The APIResourceCollection
class adds support for collections of JSON API resources. Both APIResource
and APIResourceCollection
include a [String: [APIResource]]
dictionary of resources included into the source JSON API document