I have
class StationViewController :
UITableViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet var stationTableView: UITableView!
When update the data in my data source and do
stationTableView.reloadData()
this is not immediately visible on the screen. If I scroll, tilt or do anything else which forces a repaint of the screen the updated cells are visible. I can confirm that the UITableView did do the update by calling
println("\(stationTableView.visibleCells())")
which prints the expected cells.
The rest of the setup is a UINavigationController
which has my StationViewController
as a relationship. The IBOutlet for the stationViewController
is connected to the UITableView
in the storyboard file.
I seem to need a "repaint" of the screen to make my update immediately visible. How do I do that?
Thanks to Artem, I figured out I need to call reloadData() on the main thread. This is how I solved that: