DBArraySerializer

Objective-C

@interface DBArraySerializer : NSObject

Swift

class DBArraySerializer : NSObject

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

  • Applies a serialization block to each element in the array and returns a new array 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 NSArray *)serialize:(nonnull NSArray *)value
                         withBlock:
                             (nonnull id _Nonnull (^)(id _Nonnull))serializeBlock;

    Swift

    class func serialize(_ value: [Any], with serializeBlock: @escaping (Any) -> Any) -> [Any]
  • Applies a deserialization block to each element in the array and returns a new array 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 NSArray *)deserialize:(nonnull NSArray *)jsonData
                           withBlock:(nonnull id _Nonnull (^)(id _Nonnull))
                                         deserializeBlock;

    Swift

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