All Versions
Latest Version
Avg Release Cycle
32 days
Latest Release
2995 days ago

Changelog History

  • v1.3 Changes

    April 04, 2016

    โž• Added

    • ๐Ÿ‘ Swift 2.2 support!
  • v1.2.4 Changes

    February 13, 2016

    โž• Added

    • RawRepresentable conformance to JSON
      • This includes a failable initializer with a single AnyObject argument and a compute property named rawValue of type AnyObject
    • Function for converting a JSON object back to raw NSData

      do { let data = try json.rawData(.PrettyPrinted) // do something with data} catch let error = JSON.DataError {}catch {}

  • v1.2.3 Changes

    January 20, 2016

    โž• Added

    • ๐Ÿ“ฆ Swift Package Manager support!
  • v1.2.2 Changes

    November 18, 2015

    โšก๏ธ Updated

    • ๐Ÿš€ Built-in date formatter to accept non-GMT date formats. ISO8601 formatting (yyyy-MM-dd'T'HH:mm:ss.SSSZ) is still required, but a future release will contain support for more formats. In the meantime, you can use this pattern if your models require a different format:

      private let dateFormatter = { let formatter = NSDateFormatter() formatter.format = "yyyy-MM-dd"return formatter }()private let _date = Property<String>(key: "date")public var date: NSDate? { guard let date = _date.value else { return nil } return dateFormatter.dateFromString(date) }

    ๐Ÿ›  Fixed

    • ๐Ÿ“œ Issue where time zones weren't respected while parsing JSON to/from NSDate objects
  • v1.2.1 Changes

    October 29, 2015

    ๐Ÿ›  Fixed

    • ๐Ÿ— An issue with the default implementation of fromJSON for Model types. The implementation worked without issue in simulator builds, but caused crashing on device builds. Attempting to access the dynamicType on Self currently causes problems on device builds, so dynamicType is no longer used; however, fromJSON can still be overridden in the subclass if needed.

    โšก๏ธ Updated

    • The convenience initializers on Model are now designated initializers. This allows these initializers to be overridden in subclasses.
  • v1.2 Changes

    October 27, 2015

    โž• Added

    • hasValue and hasKey to JSON (replaces isNil). The behavior of isNil was not always clear, in cases where the JSON contained a valid key but a null value. hasValue and hasKey clears this up.

      let json: JSON = ["string" : NSNull()] json["string"].hasValue// falsejson["string"].hasKey// true

    ๐Ÿ›  Fixed

    • Issue where subclassing a Model subclass resulted in broken JSONTransformable conformance.

      let json: JSON = ["cars" : [ [ "model" : "BMW", "year" : 2015, "number_of_doors" : 4] ] ]class Vehicle: Model, JSONTransformable { let model = Property<String>(key: "model") let year = Property<Int>(key: "year") }class Car: Vehicle { let numberOfDoors = Property<Int>(key: "number_of_doors") }class Garage: Model { let cars = PropertyArray<Car>(key: "cars") }let garage = Garage(json: json)// nil// valid Car object

  • v1.1 Changes

    September 17, 2015

    โž• Added

    • ๐Ÿ‘ Swift 2 support!
    • 0๏ธโƒฃ Default implementations for Model and RawRepresentable (String and Int) types.
    • isNil property on JSON

    โšก๏ธ Updated

    • Conformance to Equatable for JSON, Property, PropertyArray, and PropertyDictionary

    ๐Ÿ“‡ Renamed

    • ModelRocket class to Model, to fix a namespacing issue caused by the framework and class sharing the same name.
  • v1.0

    August 25, 2015