JSONDecoder
public struct JSONDecoder
Handles decoding Data into a Foundation object
-
Decodes
Data
into aJSONObject
.Note
if
JSONSerialization
returns a top level array then we wrap it in a dictionary.Parameters:
- data:
Data
object to be converted toJSONObject
Returns
JSONObject
Declaration
Swift
public static func decode(_ data: Data) throws -> Any
Parameters
data
Data
object to be converted toJSONObject
Return Value
JSONObject