UISearchController's table view does not layout properly when the enclosing UINavigationController has its toolbar visible

Originator:michaelhochs
Number:rdar://30011840 Date Originated:13-Jan-2017 12:52 PM
Status:Open Resolved:
Product:iOS Product Version:10.2
Classification:UI/Usability Reproducible:Always
 
Summary:
When using a UISearchController inside a UITableViewController that itself is displayed in a UINavigationController whose toolbar is set to be visible, the search controller’s table view will get an inset at the top that is of size navigationbar+toolbar, leaving a 44.0pt gap between the navigation bar and the first row of the search results.

Steps to Reproduce:
- Open the sample project
- Run it on an iPad (tested with iPad Pro 12.9” and iPad Air 2 Simulator)
- Tap the ‘Tap Me’ button in the top right corner
- Tap the search bar of the view controller that just appeared in a popover
- Type something (one letter is enough)

Expected Results:
The results table view shows all entries, starting with the first cell right belog the navigation bar / search bar.

Actual Results:
- The result table view shows all entries, but there is a gap of 44pt between the navigation bar / search bar and the first cell.
- Checking the result table view’s contentInset reveals a top value of 88pt.

Regression:

Notes:

Comments

Sample Code

https://github.com/PSPDFKit-labs/radar.apple.com/tree/master/30011840%20-%20SearchContentInset

By michaelhochs at Jan. 13, 2017, 11:55 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!