I have a UISearchController that displays it's searchResultsController (which is another view controller) when the searchbar is tapped. I do this using this UISearchController delegate method:
-(void)presentSearchController:(UISearchController *)searchController {
dispatch_async(dispatch_get_main_queue(), ^{
searchController.searchResultsController.view.hidden = NO;
});
}
However, any time the searchbar's text is empty, whether by manually deleting all text or tapping the little x button, that searchResultsController view is disappearing until I start typing text again. Any ideas why this may be happening? Is there another method or delegate method that is being triggered when searchbar.text is empty?
So after fiddling around with this for a while yesterday, this is the solution I found that ended up working. Figured I'd post it in case anyone else has the same problem!