I am using UISearchController to present a search bar inside the header view of a tableview:
...
self.searchController.hidesNavigationBarDuringPresentation =
My turn. I also had this problem when I followed the WWDC sample code.
I noticed that if I didn't set the scopeButtonTitles property of the searchBar, the searchBar would not be visible. Upon closer inspection, it just had a frame of CGRectZero. This means that setting the scopeButtonTitles sets the frame behind the scenes. So If don't want to show any scopeButtonTitles, but still want to not have to hardcode UISearchBar to a specific height, set the scopeButtonTitles to an empty array.
self.searchController = UISearchController(searchResultsController: nil)
self.searchController.searchResultsUpdater = self
self.searchController.searchBar.scopeButtonTitles = []
self.tableView.tableHeaderView = self.searchController.searchBar
Setting the scopeButtonTitles to an array of 1 strings will not display the scope button titles, but still have logic to deal with the view, essentially screwing up the layout.
Props to Apple's QA team (applicable to iOS 8)