- (UISearchController *)searchController {
if (_searchController == nil) {
_searchController = [[UISearchController alloc]initWithSearchResultsController:nil];
_searchController.searchResultsUpdater = self;
_searchController.hidesNavigationBarDuringPresentation = YES;
_searchController.dimsBackgroundDuringPresentation = YES;
self.tableView.tableHeaderView = _searchController.searchBar;
}
return _searchController;
}
Don't use UITableViewController, instead use UIViewController subclass. Arrange Searchbar and Tableview. Dont put Search bar in tableview header.
Note: UITableViewController with Indexed search always gives you extra space on right side.