Read the documentation. Inside the search controller, you can call:
self.tabBarController.selectedViewController = self;
UITabBarControlleralso has a property selectedIndexif it is more convenient for you. viewDidLoadThis is probably the wrong place to enter this code, as it may not be called every time the search controller is displayed. You must select the tab directly from the action that is called up when the user clicks the search button on the main screen.
source
share