DBMapSerializer

Objective-C

@interface DBMapSerializer : NSObject

Swift

class DBMapSerializer : NSObject

Serializer functions used by the SDK to serialize/deserialize NSArray types.

  • Applies a serialization block to each element in the map and returns a new map with all elements serialized. The serialization block either serializes the object, or if the object is a wrapper for a primitive type, it leaves it unchanged.

    Declaration

    Objective-C

    + (nonnull NSDictionary *)serialize:(nonnull NSDictionary *)value
                              withBlock:(nonnull id _Nonnull (^)(id _Nonnull))
                                            serializeBlock;

    Swift

    class func serialize(_ value: [AnyHashable : Any], with serializeBlock: @escaping (Any) -> Any) -> [AnyHashable : Any]
  • Applies a deserialization block to each element in the map and returns a new map with all elements deserialized. The serialization block either deserializes the object, or if the object is a wrapper for a primitive type, it leaves it unchanged.

    Declaration

    Objective-C

    + (nonnull NSDictionary *)deserialize:(nonnull NSDictionary *)jsonData
                                withBlock:(nonnull id _Nonnull (^)(id _Nonnull))
                                              deserializeBlock;

    Swift

    class func deserialize(_ jsonData: [AnyHashable : Any], with deserializeBlock: @escaping (Any) -> Any) -> [AnyHashable : Any]