I have tableView with a cell of multiple labels. Having cell-like, set-1 variableName1, variablevalue1 & set-2 variableName2, variablevalue2. Here all the data will get from JSON responses including the title label.
I have stored all values to model and showing some data in tableView. but I could not able to show the multiple label values alone.
Here is my JSON structure for multiple labels:
"_embedded": {
"variable": [
{
"_links": {
"self": {
"href": ""
}
},
"_embedded": null,
"name": "startedBy",
"value": "Preethi",
"type": "String",
"valueInfo": {}
},
{
"_links": {
"self": {
"href": ""
}
},
"_embedded": null,
"name": "LoanAmount",
"value": "1500000",
"type": "String",
"valueInfo": {}
}
]
},
Here I am trying to show the value from the variable array -> name & value.
Tried so far like this:
for val in (t._embedded?.variable)!{
print("val name", val.name ?? "")
print("val name", val.value ?? "")
if val.name == val.name {
cell.variableName1.text = val.name
cell.variablevalue1.text = val.value
}
if val.value == val.value {
cell.variableName2.text = val.name
cell.variablevalue2.text = val.value
}
}
here the image of the tableView cell:
Any help much appreciated pls...

