Horje
swift convert dictionary to json Code Example
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)
    }
}
swift convert dictionary to json
["A":34,"B":56]
swift convert dictionary to json
["currency": "INR", "name": "Ekluvya", "amount": 120000.0, "notes": ["boardId": "61591e494e7cd84598b0be07", "isNonAcademicCourse": true, "courseId": "615a8ec416684544d7754f5c", "user_id": "6167e8534e21a3eb921bd616", "classId": "61591dae4e7cd84598b0be04"], "theme": ["color": "#FF6700"], "image": <UIImage:0x600002634990 named(main: app_Sign) {29.333333333333332, 32}>, "prefill": ["contact": "9992921199", "email": "test@test.com"]]
convert dictionary to json serialization swift 4
["A":123, "B":455]




1

Related
swift how to sort array Code Example swift how to sort array Code Example
swift for loop index Code Example swift for loop index Code Example
replace character in swift Code Example replace character in swift Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11