0

I'm trying to solve this problem with no luck. I have a search bar and search a display controller inside table view controller.

Everything works fine - I make the server call to search the endpoint when user clicks the "Search" button and display the results. But the problem is I do not want to show No results in the table view before user clicks Search.

search wasn't clicked here

Instead of that I prefer to show default dark overlay.

rekaszeru
  • 19,130
  • 7
  • 59
  • 73
Kosmetika
  • 20,774
  • 37
  • 108
  • 172

1 Answers1

0

You could return 1 in numberOfRowsInSection while the query is in progress and leave the dummy cell empty or set its hidden property to YES so it is not visible. So you have do not have "No Results" showing up.

Also for making it a dark overlay try something like this:

- (void)searchDisplayController:(UISearchDisplayController *)controller didLoadSearchResultsTableView:(UITableView *)tableView{
    tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"default.png"]];
}

More information: Link!

Community
  • 1
  • 1
Kets
  • 438
  • 2
  • 8
  • 24