First of all, it is important to keep in mind that using UISearchDisplayController
is a trade-off between customizability and convenience. You get a lot of automatic stuff for free, but if you require a lot of customization it might not suit your needs. It works best as a drop-in solution, and if you'd really like to use it, I recommend you work your app around it instead of trying to hack its behavior.
With that said, why don't you make the UITableView
return a single row when there are no results? This row could either be empty, display some boilerplate text or an image (sad face or something humorous that matches the app).
Having a single row to be presented, the default "No Results" label from UISearchDisplayController
would not be shown. This is the default behavior for a lot of Apps, like Instagram (check out the Explore tab), Kindle and the default Notes.app, although they are probably not using UISearchDisplayController
.
If you find that this workaround doesn't fit your app, you could also try making the "Missing a Brand" view into the header view of the first section of the UISearchResultsTableView
(instead of the footer view). That way, the "No Results" label would be displayed below it. Combining this idea with a single empty row would even work better.
A third option would be to insert this view on top of the UISearchResultsTableView
. This could be done every time there were no results (properly removing it when necessary) or just a single time, using its hidden property to show or hide it instead.
Any other method for hiding this label is probably hacky, like this one: https://stackoverflow.com/a/11715841/382834. Although easier on your current logic, it might have negative consequences later on, so it's possibly the worst path to follow.