Reload data on UITableView that is not being displayed
<p>In iOS, are there any potential pitfalls to reloading a UITableView that is not currently being displayed?</p>

<p>I have found that I had some very peculiar bugs where cell content was disappearing but it only seemed to happen when I had switched to another Tab.. (the UIViewController with tableView on the first tab is still in memory and responding to external API updates) </p>

<p>so the line:</p>

<pre><code>dispatch_async(dispatch_get_main_queue(), {

    self.tableView.reloadRowsAtIndexPaths([NSIndexPath(forRow: row, inSection: 0)], withRowAnimation: UITableViewRowAnimation.None)

}
</code></pre>

<p>is executing code to modify the display of a table that is not actually being displayed and this is when the bug was happening. </p>

<p>if I added some code to the viewControllers ViewDidAppear and ViewDidDisappear to basically block updates to the tableView (and then do a full refresh when re-entering that viewController) it seemed to solve the problem.  </p>

<pre><code>dispatch_async(dispatch_get_main_queue(), {

    if self.delegate.viewIsDisplayed() {
       self.tableView.reloadRowsAtIndexPaths([NSIndexPath(forRow: row, inSection: 0)], withRowAnimation: UITableViewRowAnimation.None)
    }

}
</code></pre>

<p>I do not know why the problem was happening and was hoping someone might be able to shine some light on what I was observing before (cells randomly clearing content and then re-appearing on each subsequent reload)</p>