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
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()
})
})