Skip to content

Releases: tristanhimmelman/ObjectMapper

Swift 3 support

14 Sep 02:12
Compare
Choose a tag to compare
  • Support for Swift 3
  • The Mappable extension now supports the MapContext
  • Updates to Mapper to make function definitions require named parameters

1.5.0

07 Sep 13:42
Compare
Choose a tag to compare
  • ObjectMapper can now be implemented within an extension using the StaticMappable protocol. (Thanks @andrebraga)

Below is the new protocol structure

/// BaseMappable should not be implemented directly. Mappable or StaticMappable should be used instead
public protocol BaseMappable {
    /// This function is where all variable mappings should occur. It is executed by Mapper during the mapping (serialization and deserialization) process.
    mutating func mapping(map: Map)
}
public protocol Mappable: BaseMappable {
    /// This function can be used to validate JSON prior to mapping. Return nil to cancel mapping at this point
    init?(_ map: Map)
}
public protocol StaticMappable: BaseMappable {
    /// This function should return an instance of BaseMappable that ObjectMapper will use for mapping. It can also be used to:
    ///     1) provide an existing cached object to be used for mapping
    ///     2) return an object of another class (which conforms to Mappable) to be used for mapping. For instance, you may inspect the JSON to infer the type of object that should be used for any given mapping
    ///     3) perform validation prior to mapping
    static func objectForMapping(map: Map) -> BaseMappable?
}
  • Compilation speed improvements (@ivanbruel)
  • NSDataTransform

Swift 2.3 and StaticMappable protocol

06 Aug 15:38
Compare
Choose a tag to compare

StaticMappable protocol is a sub protocol of Mappable which provides access to the objectForMapping function

Mappable protocol updates, new MapContext and NSDecimalNumberTransform

12 May 14:29
Compare
Choose a tag to compare
  • Removed the MappableCluster protocol by adding the objectForMapping function into Mappable and adding a default implementation in an extension making it an optional function
  • Created MapContext protocol which can be implemented by developers and used to pass information around during mapping. Pass the MapContext object into Mapper in init and the context will be available in the Map object (map.context) during mapping.
  • Added NSDecimalNumberTransform

Swift 2.2 warning fixes, Nil object support (Xcode 7.3 required)

25 Mar 16:03
Compare
Choose a tag to compare
  • Updates to support Swift 2.2 changes
  • JSON containing nil objects is no longer ignored. This is especially important when mapping to an existing object where the developer may want to remove a variable based on a nil JSON object.

OS X Build error fix

18 Feb 23:37
Compare
Choose a tag to compare
Merge pull request #392 from Hearst-DD/bitcode

Bitcode

Enabled BITCODE for watchOS and tvOS

16 Feb 14:14
Compare
Choose a tag to compare
1.1.4

Enabled bitcode for watchOS and tvOS

Performance improvement

15 Feb 21:34
Compare
Choose a tag to compare
1.1.3

40-50% performance fix

Exposed JSONDictionary in Map class

08 Feb 14:19
Compare
Choose a tag to compare
Merge pull request #379 from zulkis/master

JSONDictionary public getter

1.1.1

04 Jan 18:05
Compare
Choose a tag to compare
  • Deployment target updates
  • Exposed toJSONString(JSONDict: AnyObject, prettyPrint: Bool) function