AnyCodable

public struct AnyCodable : Codable
extension AnyCodable: Equatable
extension AnyCodable: CustomStringConvertible
extension AnyCodable: CustomDebugStringConvertible
extension AnyCodable: ExpressibleByNilLiteral
extension AnyCodable: ExpressibleByBooleanLiteral
extension AnyCodable: ExpressibleByIntegerLiteral
extension AnyCodable: ExpressibleByFloatLiteral
extension AnyCodable: ExpressibleByStringLiteral
extension AnyCodable: ExpressibleByArrayLiteral
extension AnyCodable: ExpressibleByDictionaryLiteral

A type-erased Codable value.

The AnyCodable type forwards encoding and decoding responsibilities to an underlying value, hiding its specific underlying type.

You can encode or decode mixed-type values in dictionaries and other collections that require Encodable or Decodable conformance by declaring their contained type to be AnyCodable.

See also

AnyEncodable

See also

AnyDecodable

Source: https://github.com/Flight-School/AnyCodable

  • Declaration

    Swift

    public static func == (lhs: AnyCodable, rhs: AnyCodable) -> Bool
  • Declaration

    Swift

    public var description: String { get }
  • Declaration

    Swift

    public var debugDescription: String { get }