PMJSON v3.1.0 Release Notes

Release Date: 2018-02-26 // about 6 years ago
    • ๐Ÿ‘Œ Improve .pretty output for empty arrays/dictionaries.
    • Speed up JSON.encodeAsData() pretty significantly. It's now very nearly as fast as JSON.encodeAsString().
    • Speed up JSON.Encoder.encodeAsString() and JSON.Encoder.encodeAsData().
    • Add a couple of convenience static methods to JSON that mimic the enum cases: JSON.int(_:) and JSON.cgFloat(_:). These can be used when JSON(_:) triggers too much type complexity. Also add a JSON(_:) override for CGFloat.
    • โž• Add JSON.Encoder.keyEncodingStrategy. This is very similar to Swift 4.1's JSONEncoder.keyEncodingStrategy, although by default it won't apply to any nested values of type JSON or JSONObject (there's another option applyKeyEncodingStrategyToJSONObject that controls this).
    • โž• Add JSON.Decoder.keyDecodingStrategy. This is very similar to Swift 4.1's JSONDecoder.keyDecodingStrategy, although by default it won't apply to decoding any values of type JSON or JSONObject (there's another option applyKeyDecodingStrategyToJSONObject that controls this).
    • โž• Add JSON.Encoder.dateEncodingStrategy. This is very similar to JSONEncoder.dateEncodingStrategy except it includes another case for encoding ISO8601-formatted dates with fractional seconds (on Apple platforms).
    • โž• Add JSON.Decoder.dateDecodingStrategy. This is very similar to JSONDecoder.dateDecodingStrategy except it includes another case for decoding ISO8601-formatted dates with fractional seconds (on Apple platforms).
    • โž• Add JSON.Encoder.dataEncodingStrategy. This is identical to JSONEncoder.dataEncodingStrategy.
    • โž• Add JSON.Decoder.dataDecodingStrategy. This is identical to JSONDecoder.dataDecodingStrategy.