I have the following code in my application, especially in viewDidLoad: which sets my UISearchController .
self.searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; self.searchController.searchResultsUpdater = self; self.searchController.hidesNavigationBarDuringPresentation = NO; self.searchController.dimsBackgroundDuringPresentation = NO; self.definesPresentationContext = NO; self.searchController.searchBar.scopeButtonTitles = @[]; self.searchController.searchBar.searchBarStyle = UISearchBarStyleProminent; [_tableView setTableHeaderView:_searchController.searchBar];
Whenever a search string is called (which is added to the tableView ), the color of the UIStatusBar changes from UIStatusBarStyleLightContent to dark (white to black). Now, I realized if I installed,
self.definesPresentationContext = NO;
to the next:
self.definesPresentationContext = YES;
The problem is resolved and the color of the UIStatusBar maintained. However, another problem arises. If the self.definesPresentationContext parameter self.definesPresentationContext set to YES , when you call, the search string is shifted for any reason, by coincidence (or by right) right below where the UIRefreshControl displayed on the tableView at the tableView .
source share