-6

i want to create a json array in the below format in swift 3

{

"parameter" :

[ {

"key" : "paymentType",

"value" : "F"

} ]

}
Ashish Bahl
  • 1,482
  • 1
  • 18
  • 27

1 Answers1

0

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.

Ciaran Lyne
  • 129
  • 6