JSONDecoder

public struct JSONDecoder

Handles decoding Data into a Foundation object

  • Decodes Data into a JSONObject.

    Note

    if JSONSerialization returns a top level array then we wrap it in a dictionary.

  • Parameters:

    • data: Data object to be converted to JSONObject
  • Returns

    JSONObject

    Declaration

    Swift

    public static func decode(_ data: Data) throws -> Any

    Parameters

    data

    Data object to be converted to JSONObject

    Return Value

    JSONObject