Answers for "convert dictionary to json serialization swift 4"

1

swift convert dictionary to json

let dic = ["2": "B", "1": "A", "3": "C"]
let encoder = JSONEncoder()
if let jsonData = try? encoder.encode(dic) {
    if let jsonString = String(data: jsonData, encoding: .utf8) {
        print(jsonString)
    }
}
Posted by: Guest on January-29-2020
1

convert dictionary to json serialization swift 4

["A":123, "B":455]
Posted by: Guest on May-18-2020

Code answers related to "convert dictionary to json serialization swift 4"

Code answers related to "Javascript"

Browse Popular Code Answers by Language