Bool

struct Bool
  • Converts an instance of a conforming type to JSON. - returns: An instance of JSON where the enum case is .bool.

    Declaration

    Swift

    public func toJSON() -> JSON

    Return Value

    An instance of JSON where the enum case is .bool.

  • An initializer to create an instance of Bool from a JSON value. - parameter json: An instance of JSON. - throws: The initializer will throw an instance of JSON.Error if an instance of Bool cannot be created from the JSON value that was passed to this initializer.

    Declaration

    Swift

    public init(json: JSON) throws

    Parameters

    json

    An instance of JSON.