1

I am wondering the following: What is the best way to set up a searchbar that is available in all child view controllers of the navigation controller on the ipad (Hence in the entire application in my case).

A perfect example in which this is done is the IMDB application on the iPad, where each view controller with its presented views shows a search bar in the navigation bar that uses the same datasource.

I found the following post on this topic: Same UISearchBar for entire app?

However,I am not completely satisfied with the answer yet. I would like to know whether it is possible to show it in the navigation bar everywhere using either the function:

[self.navigationItem setTitleView:mySearchBar];

or: [self.navigationItem setTitleView:mySearchBar];

searchDisplayController.displaysSearchBarInNavigationBar = YES;

at a specific location, hence not in each view controller. I thought of adding the search bar in the prepareforsegue function every time, but there must be a more convenient and nicer way.

Also, if you would suggest to work with container view controllers, how would this work with other navigation items? Can one adjust the size of the view UIsearchbar when more navigation bar items (buttons) are presented for a certain view controller?

Community
  • 1
  • 1

0 Answers0