AnyCodable
public struct AnyCodable
extension AnyCodable: Codable
extension AnyCodable: Equatable
extension AnyCodable: CustomStringConvertible
extension AnyCodable: CustomDebugStringConvertible
extension AnyCodable: ExpressibleByNilLiteral, ExpressibleByBooleanLiteral, ExpressibleByIntegerLiteral, ExpressibleByFloatLiteral, ExpressibleByStringLiteral, ExpressibleByArrayLiteral, ExpressibleByDictionaryLiteral
A type-erased Codable value.
You can encode or decode mixed-type or unknown values in dictionaries
and other collections that require Encodable or Decodable conformance
by declaring their contained type to be AnyCodable.
-
Declaration
Swift
public init(from decoder: Decoder) throws -
Declaration
Swift
public func encode(to encoder: Encoder) throws -
Declaration
Swift
public static func == (lhs: AnyCodable, rhs: AnyCodable) -> Bool -
Declaration
Swift
public var description: String { get } -
Declaration
Swift
public var debugDescription: String { get } -
Declaration
Swift
public init(nilLiteral: ()) -
Declaration
Swift
public init(booleanLiteral value: Bool) -
Declaration
Swift
public init(integerLiteral value: Int) -
Declaration
Swift
public init(floatLiteral value: Double) -
Declaration
Swift
public init(extendedGraphemeClusterLiteral value: String) -
Declaration
Swift
public init(stringLiteral value: String) -
Declaration
Swift
public init(arrayLiteral elements: Any...) -
Declaration
Swift
public init(dictionaryLiteral elements: (AnyHashable, Any)...)