Hello, I need help, I do not know how to do a JsonArray
in swift 3, the only thing I've achieved is to do this:
{ "Etiqueta":"valor", "":"", "":"" }
and what I need to do is this:
[
{
"Etiqueta":"valor",
"Etiqueta":"valor",
"Etiqueta":"valor"
},
{
"Etiqueta":"valor",
"Etiqueta":"valor",
"Etiqueta":"valor"
}
]
the code I use to create the json
is this:
var json = [String : AnyObject]()
var arrayFinish = [String: AnyObject]()
json["idProducto"] = String(celda) as AnyObject
json["comentario"] = tfComentario.text! as AnyObject
json["TipoUnidad"] = pickerselected as String as AnyObject
json["Cantidad"] = cantidad as String as AnyObject
json["Medida"] = medidas as String as AnyObject
json["telefono"] = telefono as String as AnyObject
arrayFinish["productos"]?.add(json)
and the only thing I get is [:]
like this is shown in log
Someone to help me please