swift - How to convert a JSON string to a dictionary? - Stack Overflow

PHOTO EMBED

Thu Sep 15 2022 13:00:15 GMT+0000 (Coordinated Universal Time)

Saved by @Raihan #swift

let value1 = try? data.toDictionary()
let value2 = try? data.to(type: [String: Any].self)
let value3 = try? data.to(type: [String: String].self)
let value4 = try? string.asJSONToDictionary()
let value5 = try? string.asJSON(to: [String: String].self)
content_copyCOPY

https://stackoverflow.com/questions/30480672/how-to-convert-a-json-string-to-a-dictionary