I\'m trying to get some variables from JSON response and display it in a custom table view.. the problem is that the variables are never updated.. for more explanations here\'s
write this in your address function after fetching the data into your arrays
DispatchQueue.main.async{
tableView.reloadData()
}
1- Reload the table
if let address = receivedTodo["address"] as? [[String:Any]] {
for info in address {
self.label.append(info["label"] as! String)
//self.street.append(info["description"] as! String)
//self.building.append(info["building_number"] as! String)
}
}
DispatchQueue.main.async {
self.tableView.reloadData()
}
2- Verify by a print before reload as you may have a nil response