I have a simple JSON object:
{
\"values\": {
\"a\":\"\",
\"b\":\"\",
\"c\":\"\",
\"d\":\"\",
\"e\":\"\"
}
}
<
Back to the old fashion way, use JSONSerialization.jsonObject(with: Data, options: JSONSerialization.ReadingOptions) -> Any.
It does keep order..... UNTIL you cast json?["values"] into a [String: Any]. At this time what Cezar says in the above answer enters the scene: dictionaries are unordered.
The following screenshot shows that, until json?["values"] is an Any, the order is kept in the string description.