I set setShowsScopeBar to TRUE from the start and it works fine. But as soon as I search for something and then cancel the search, the Scope panel will disappear.
How to save scope even after clicking Cancel?
Apparently, in an earlier version, with the UISearchBar,
- (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar
{
[searchBar setShowsScopeBar:YES];
return YES;
}
It worked. But with SearchController this is no longer the case.
I tried this:
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {
searchController.searchBar.showsScopeBar = YES;
[searchController.searchBar sizeToFit];
isSearching = NO;
}
no luck.
Are there any possible solutions on iOS 9?
source
share