UISearchBar disappears from tableHeaderView when using beginUpdates/endUpdates : <p>I have a table view controller with a <code>UISearchController</code> that sets  <code>UISearchBar</code> as the <code>tableView.tableHeaderView</code>. When updating the search results, I use the <code>beginUpdates</code> and <code>endUpdates</code> and related methods to update the data for the table view.</p>

<p>This makes the search bar disappear; the <code>tableHeaderView</code> is set to an empty, generic <code>UIView</code> of the same size as the search bar. If I simply use <code>reloadData</code> instead of the whole <code>beginUpdates</code>/<code>endUpdates</code> procedure, everything is fine.</p>

<p>The table view controller is embedded in a regular view controller; there is no navigation controller involved. This is the entire implementation of the table view controller necessary to reproduce the issue:</p>

<pre><code>- (void)viewDidLoad
{
    [super viewDidLoad];

    self.searchController = [[UISearchController alloc] initWithSearchResultsController:nil];
    self.searchController.searchResultsUpdater = self;
    self.searchController.dimsBackgroundDuringPresentation = NO;

    self.tableView.tableHeaderView = self.searchController.searchBar;
}

- (void)updateSearchResultsForSearchController:(UISearchController *)searchController
{
    [self.tableView beginUpdates];
    [self.tableView endUpdates];
}
</code></pre>

<p>Why does this cause the search bar to be replaced with a blank view, and how can it be avoided?</p>
