Here's what worked for me:
DO:
- Use UISearchController (not a separately placed UISearchBar)
- Place your VC in a UINavigationController if it isn't already. Set the nav not to "Show Navigation Bar" if desired.
- Use autolayout for the UITableView (not springs and struts) and pin the top of the table to the top of the VC's view.
- Add this delegate method:
- (UIBarPosition)positionForBar:(id)bar {
return UIBarPositionTopAttached;
}
DON'T:
- Fiddle with edgesForExtendedLayout
- Fiddle with extendedLayoutIncludesOpaqueBars
- Fiddle with the table's contentInset