This app allows Rider to request a ride and driver to accept the request. In this tableview are the rides the riders (2) have requested.
Unable to update tableviewcel
The callbacks from Geocoder are asynchronous and you can't simply change the values in the table cells by updating the label values inside the callback - you have to inform the table view to reload the cell in order to update it.
So, you need to pull out the GeoCoder lookups from inside tableView:cellForRowAt and move them into a loop in either viewDidLoad or viewWillAppear. The final values should form part of you model.
Inside the callbacks for the GeoCoder you would then tell the table view to reload each individual cell calling tableView.reloadRows with a single value array.
make sure you reload tableview in main queue in with parameter closure
.
ref.child("drivers").child("RideRequests").observe(FIRDataEventType.value, with: { snapshot in
self.rideRequests.removeAll()
for item in snapshot.children{
self.rideRequests.append(item as! FIRDataSnapshot)
}
self.rideRequests.reverse()
DispatchQueue.main.async (execute: { () -> Void in
self.tableView.reloadData()
})
})