I am having this problem with the status bar and tab bar.

Here is my code:
self.searchResultsController = [BZDashboardSearchResultsController new]; self.searchController = [[UISearchController alloc] initWithSearchResultsController:self.searchResultsController]; self.searchController.hidesBottomBarWhenPushed = YES; self.searchController.searchResultsUpdater = self; self.searchController.hidesNavigationBarDuringPresentation = YES; self.definesPresentationContext = YES; self.searchController.dimsBackgroundDuringPresentation = NO; self.searchController.view.backgroundColor = [UIColor whiteColor]; self.searchController.delegate = self; self.searchController.searchBar.delegate = self; [self presentViewController:self.searchController animated:YES completion:nil];
I want to hide the tab bar by positioning the search bar in the status bar. The controller hierarchy of my view looks like this:
UITabBarController --UINavigationController ---View Controller where the above code is executed.
In my application, I installed a subclass of UITabBarController as the root view controller:
self.window.rootViewController = tabBarViewController;
The init method of this subclass is as follows:
-(instancetype)init { self = [super init]; if (self) { UINavigationController *workspaceNavigationController = [[UINavigationController alloc] initWithRootViewController:self.workspaceController]; self.userProfileViewController.showLogoutButton = YES; UINavigationController *userProfileNavigationController = [[UINavigationController alloc] initWithRootViewController:self.userProfileViewController]; self.viewControllers = @[workspaceNavigationController, userProfileNavigationController]; } return self; }
self.workspaceController has a search button in its code navigation bar that defines the UiSearchController.
source share