SmartDecodable

public protocol SmartDecodable : Decodable

Undocumented

  • didFinishMapping() Default implementation

    Callback invoked after successful decoding for post-processing

    Default Implementation

    Declaration

    Swift

    mutating func didFinishMapping()
  • mappingForKey() Default implementation

    Defines key mapping transformations during decoding First non-null mapping is preferred

    Default Implementation

    Declaration

    Swift

    static func mappingForKey() -> [SmartKeyTransformer]?
  • mappingForValue() Default implementation

    Defines value transformation strategies during decoding

    Default Implementation

    Declaration

    Swift

    static func mappingForValue() -> [SmartValueTransformer]?
  • Undocumented

    Declaration

    Swift

    init()

SmartModel+SmartDecodable

SmartDecodable

  • Deserializes into a model

    Declaration

    Swift

    public static func deserialize(from dict: [String : Any]?, designatedPath: String? = nil, options: Set<SmartDecodingOption>? = nil) -> Self?

    Parameters

    dict

    Dictionary

    designatedPath

    Specifies the data path to decode

    options

    Decoding strategy Duplicate enumeration items are not allowed, e.g., multiple keyStrategies cannot be passed in [only the first one is effective].

    Return Value

    Model

  • Deserializes into a model

    Declaration

    Swift

    public static func deserialize(from json: String?, designatedPath: String? = nil, options: Set<SmartDecodingOption>? = nil) -> Self?

    Parameters

    json

    JSON string

    designatedPath

    Specifies the data path to decode

    options

    Decoding strategy Duplicate enumeration items are not allowed, e.g., multiple keyStrategies cannot be passed in [only the first one is effective].

    Return Value

    Model

  • Deserializes into a model

    Declaration

    Swift

    public static func deserialize(from data: Data?, designatedPath: String? = nil, options: Set<SmartDecodingOption>? = nil) -> Self?

    Parameters

    data

    Data

    designatedPath

    Specifies the data path to decode

    options

    Decoding strategy Duplicate enumeration items are not allowed, e.g., multiple keyStrategies cannot be passed in [only the first one is effective].

    Return Value

    Model

  • Deserializes into a model

    Declaration

    Swift

    public static func deserializePlist(from data: Data?, designatedPath: String? = nil, options: Set<SmartDecodingOption>? = nil) -> Self?

    Parameters

    data

    Data

    designatedPath

    Specifies the data path to decode

    options

    Decoding strategy Duplicate enumeration items are not allowed, e.g., multiple keyStrategies cannot be passed in [only the first one is effective].

    Return Value

    Model

Available where Self: SmartEncodable

  • Undocumented

    Declaration

    Swift

    public mutating func mergeAny(from object: Any?, designatedPath: String? = nil)