I have been having several issues with the UISearchController since the first day, but I always managed to work around it. With tvOS 14 however, I have now a problem that I don't understand:
- I present my tab controller
- From one of the viewController of the tabController, I present the searchController;
- I press menu to dismiss it.
RESULT: the searchController and the whole tabController are dismissed.
EXPECTED: only the searchController should be dismissed and go back to the viewController I presented it from.
This only happens in tvOS14, in tvOS13.X works well.
I tried to check the presentingViewController
before dismissing it, and for some reason it is the tabController instead of the viewController I presented it from.
This is the piece of code to present:
UISearchController *searchController = [[UISearchController alloc] initWithSearchResultsController:resultVC];
searchController.searchResultsUpdater = resultVC;
searchController.delegate = resultVC;
searchController.searchBar.delegate = resultVC;
[strongSelf presentViewController:searchController animated:YES completion:nil];
and when I press menu, or execute this code from a button's action in the resultVC:
[self dismissViewControllerAnimated:YES completion:nil];
I get the result explained above. Same result if I do:
[self.searchController dismissViewControllerAnimated:YES completion:nil];
I also tried wrapping everything into a UISearchContainerViewController
, but the result is the same.
Does anyone have any clue?