I'm trying to get a search bar and it's scope in the navigation bar, as the way the view first appears. If you simply drag a UISearchBar onto you table view controller in interface builder, it's placed in your table like a header cell. Then, when you tap it, it animates into the formation I'm after below. The problem is I want it to start out this way without any tapping, with a back button on the left and no cancel button on the right:
So, to give the search bar immediate focus without tapping, I tried adding [_searchBar becomeFirstResponder];
in viewDidLoad which doesn't work. Next I tried:
self.searchDisplayController.displaysSearchBarInNavigationBar = YES;
The search bar will indeed display in the navigation bar but the scope bar is gone, (WHY APPLE WHY) and there is an awkward gap.
I've also tried subclassing UINavigationBar and making it taller. It's easy to change it's size but the contents align at the bottom of the bar and overlap anything you try to add to it.
So to re-iterate, I need the search bar to display in the navigation bar with a scope control when the view first appears, without any tapping by the user. I should also specify that this is on a UITableViewController (because the page has a UIRefreshConrol), so simply dropping a toolbar in above the table view isn't an option. Thanks.