Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
There is a very useful library in Android development (RETROFIT2) to convert JSON into Java classes in one step.
Is there a similar library in Swift to convert JSON to Swift classes?

Thank you

What I have tried:

import Foundation

let data: Data // received from a network request, for example
let json = try? JSONSerialization.jsonObject(with: data, options: [])
Posted
Comments
Richard MacCutchan 19-Oct-17 6:03am    
What does Google or the documentation say?
Richard Deeming 20-Oct-17 12:25pm    
fmikele 23-Oct-17 13:23pm    
The conversion from JSON to complex Java object is direct. The call result to the APIs returns the Java object directly. The Java object was obviously built automatically by the JSON structure through a tool.
It is very strange that there is no library in Swift / iOS that does the same thing.
Thank you so much

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900