Hello can you help me I want to display in an TableView an array of objects but only one compoment of the array.
here my code:
extension ViewController: UITableViewDataSource {
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as UITableViewCell
let index = indexPath.row as Int
for dep in autoCompleteDestino {
DestinoInstancia.idDestino = dep.idDestino!
DestinoInstancia.desDestino = dep.desDestino!
autoCompleteDestino.append(dep)
}
print(autoCompleteDestino)
cell.textLabel?.text = String(describing: autoCompleteDestino[index])
return cell
}
}
So..i want to show in this line, only the DestinoInstancia.desDestino = dep.desDestino!
cell.textLabel?.text = String(describing: autoCompleteDestino[index])
Currently shows me this way:
MTiOS.Destinos(idDestino: Optional(1), desDestino: Optional("Asunción")), MTiOS.Destinos(idDestino: Optional(2), desDestino: Optional("Miami")), MTiOS.Destinos(idDestino: Optional(3), desDestino: Optional("Atenas")), MTiOS.Destinos(idDestino: Optional(5), desDestino: Optional("Madrid"))]
When i want to show me only:
Asunción Miami Atenas Madrid
Please Help!
