How to show/hide UISearchController searchBar in UITableView?
<p>In my app I have the following setup:</p>

<ul>
<li>UIViewController</li>
<li>UITableView as a subview</li>
<li><p>tableView has a UISearchController and a search bar is a table header view</p>

<p>_tableView.tableHeaderView = _searchController.searchBar;</p></li>
</ul>

<p>What I want to achieve is:</p>

<ul>
<li>when this screen appears the searchBar is not there</li>
<li>tap some button (nav controller right button for example) the search bar appears (maybe animates from top or something)</li>
<li>tap that button again the search bar hides</li>
</ul>

<p>when the search bar is not showing the table looks like that bar was never there ( there is no empty header cell or anything like that) </p>

<p>Any kind of help is highly appreciated!</p>