Encodable

public extension Encodable
  • Transforms an Encodable object into a [String: Any] dictionary.

    Declaration

    Swift

    func dictionary(with encoder: JSONEncoder) -> [String : Any]?

    Parameters

    encoder

    The encoder to use in the transformation.

    Return Value

    A dictionary containing the key and value of the encodable item.