How can I hide a UISearchDisplayController from a UITableView natively? I just want the user to browse the UISearchBar page.
UPDATE: I think the scroll of the UITableView is 40px lower so that the UISearchBar can be βhiddenβ from the user.
My solution is in viewWillAppear:animted :
viewWillAppear:animted
[my_table_view setContentOffset:CGPointMake(0, searchController.searchBar.bounds.size.height)];
UPDATE we should get the height of the UISearchBar instead of using fixed values.
UISearchBar
This is how I hide the search bar in view. This cut off will ensure that the search bar is first hidden only the first time the call appears.
- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; //hide search bar if (_searchBarRevealed == NO) { self.tableView.contentOffset = CGPointMake(0, 44); _searchBarRevealed = YES; } }