The below problem only occurs on an iOS 6.0/6.1 application running on an iOS 7.0+ device.
So I have a UISearchDisplayController that searches our API an
This system bug remains in iOS 8, and the accept answer's solution doesn't work anymore. So, you should use the following solution:
-(void)searchDisplayController:(UISearchDisplayController *)controller didHideSearchResultsTableView:(UITableView *)tableView {
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil];
}
-(void)searchDisplayController:(UISearchDisplayController *)controller willShowSearchResultsTableView:(UITableView *)tableView {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
}
-(void)keyboardWillHide:(NSNotification*)notification {
CGFloat height = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size.height;
UITableView *tableView = [[self searchDisplayController] searchResultsTableView];
UIEdgeInsets inset;
[[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0 ? (inset = UIEdgeInsetsMake(0, 0, height, 0)) : (inset = UIEdgeInsetsZero);
[tableView setContentInset:inset];
[tableView setScrollIndicatorInsets:inset];
}