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
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)
}
}
convert dictionary to json serialization swift 4
["A":123, "B":455]
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": "[email protected]"]]
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us