I am using UISearchController to search for data in my tableview. I am not using table view controller. I would like to hide the navigation bar when my search b
I managed to resolve this issue by combining RJiryes answer with scroll to top.
-(void)willPresentSearchController:(UISearchController *)searchController{
[self.contactsTableView setContentInset:UIEdgeInsetsMake(20, 0, 0, 0)];
[self.contactsTableView setContentOffset:CGPointMake(0.0f, -self.contactsTableView.contentInset.top) animated:YES];
}
-(void)willDismissSearchController:(UISearchController *)searchController{
[self.contactsTableView setContentInset:UIEdgeInsetsMake(0, 0, 0, 0)];
}