I want to parse json in below in swift 4 but sellOrders and buyOrders are return empty.
JSON:
{
marketName: "btc_tl",
chartData: [ ],
sellOrders: {
39970.00: "1.42476125",
39980.00: "0.92996500",
39990.00: "0.03751539",
39998.00: "0.33341067",
40000.00: "0.16707899",
40320.00: "0.01657837",
40327.00: "0.24812160",
40331.00: "0.20076547"
},
buyOrders: {
39970.00: "1.42476125",
39980.00: "0.92996500",
39990.00: "0.03751539",
39998.00: "0.33341067",
40000.00: "0.16707899",
40320.00: "0.01657837",
40327.00: "0.24812160",
40331.00: "0.20076547"
},
marketMatches: [],
userMatches: []
}
I use code in below. How can I reach sellOrders
or buyOrders
in that json?
let jsonResponse = try JSONSerialization.jsonObject(with:
dataResponse, options: [])