Tough to say what exactly is causing the problem, but it seems to be a timing issue.
In ViewController, change your didSet to this:
var timecard: Timecard? {didSet {
if self.isViewLoaded {
DispatchQueue.main.async {
self.employeeTableView.reloadData()
self.timecardTableView.reloadData()
}
}
}}
In your minimal example, that seems to fix the issue.
Without spending a lot more time on it, my guess would be that you've got a closure that's holding onto the cell being edited, preventing the table view from reloading? Maybe something similar to that.
On a side note -- you've got some rather unusual stuff going on. Generally a bad idea to assign things like this:
weak var viewController: ViewController?
And, it looks like your closures could be problematic in a couple ways (row index can change, looks like you're creating strong references that can cause retain cycles, etc).
.reloadData()actually being called? If so, is the propercellForRowAtbeing called? If so, does the data you're giving to the cell reflect the change? If so, is whatever's going on in the cell class to display the data executing correctly? If the answer to any of those "if so" questions is no - that's where to look for the problem.reloadData()is being called andcellForRowAtis being called with all the other tables views, but not the specific one I've mentioned(but only in some cases). I've spent several hours debugging and I'm a little stumped at what to try next..reloadData()is being called on "the other table views" from somewhere else.