NEW: Subscribe to Hacking with Swift+ and accelerate your learning! >>

Decode this king of JSON

Forums > Swift

Hi,

I'm trying to decode this kind of JSON data but I don't understand haw to do with this dynamic keys.

Thanks for your help.

Chris

{ "result": { "dataType1": { "2015-06-22 05:15:00": 17, "2015-06-22 05:30:00": 22, "2015-06-22 05:45:00": 27, ... "2015-06-29 20:15:00": 14, "2015-06-29 20:30:00": 11, "2015-06-29 20:45:00": 7 }, "dataType2": { "2015-06-22 05:15:00": 0, "2015-06-22 05:30:00": 6, "2015-06-22 05:45:00": 12, ... "2015-06-29 20:15:00": 2545, "2015-06-29 20:30:00": 2548, "2015-06-29 20:45:00": 2550 }, "dataType3": { "2015-06-22": 2626, "2015-06-23": 2918, "2015-06-24": 2526, "2015-06-25": 2866, "2015-06-26": 2892, "2015-06-27": 1900, "2015-06-28": 2199, "2015-06-29": 2550 } }, "message": { "type": "success", "code": 0, "text": "" } }

   

Hacking with Swift is sponsored by Paw

SPONSORED Use Paw to build, test and describe web APIs. Paw has a lightning fast native macOS interface to compose requests, collaborate in real-time on API specs, and generate client code for your applications. You can import and export API definitions.

Discover Paw for Mac

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

Not logged in

Log in
 

Link copied to your pasteboard.