AnyJSON

public struct AnyJSON : ExpressibleByStringLiteral, ExpressibleByArrayLiteral, ExpressibleByDictionaryLiteral, ExpressibleByIntegerLiteral, ExpressibleByFloatLiteral, ExpressibleByBooleanLiteral

A generic JSON value type that can be expressed with Swift Literals

Initializers

  • Create an AnyJSON from any type

    Declaration

    Swift

    public init(_ obj: Any)

    Parameters

    obj

    The object

API

  • obj

    The object wrapped by this AnyJSON wrapper

    Declaration

    Swift

    public private(set) var obj: Any { get }

ExpressibleByDictionaryLiteral

  • Key

    Declaration

    Swift

    public typealias Key = AnyHashable
  • Declaration

    Swift

    public typealias Value = Any
  • Declaration

    Swift

    public init(dictionaryLiteral elements: (AnyHashable, Any)...)

ExpressibleByStringLiteral

ExpressibleByArrayLiteral

ExpressibleByFloatLiteral

ExpressibleByIntegerLiteral

ExpressibleByBooleanLiteral

Subscripting

  • Undocumented

    Declaration

    Swift

    public subscript(key: AnyHashable) -> AnyJSON { get set }
  • Undocumented

    Declaration

    Swift

    public subscript(index: Int) -> AnyJSON { get set }