i want to create a json array in the below format in swift 3
{
"parameter" :
[ {
"key" : "paymentType",
"value" : "F"
} ]
}
i want to create a json array in the below format in swift 3
{
"parameter" :
[ {
"key" : "paymentType",
"value" : "F"
} ]
}
Using SwiftyJson
var jsonArray: JSON = ["parameter": ["key": "paymentType","value": "F"]]
Best I could do with the information you gave. Hardcoding values into something like this isn't usualy the best idea so I would recommend you go and try learn a bit more about SwiftyJSON which might make working with JSON a bit easier for you.