All Versions
8
Latest Version
1.3
Avg Release Cycle
32 days
Latest Release
1464 days ago

Changelog History

  • v1.3

    April 04, 2016

    ➕ Added

    • 👍 Swift 2.2 support!
  • v1.2.4

    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

    January 20, 2016

    ➕ Added

    • 📦 Swift Package Manager support!
  • v1.2.2

    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

    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

    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)// previouslygarage.cars.first// nil// nowgarage.cars.first// valid Car object

  • v1.1

    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