Display problems with UISplitViewController and UISearchController

Originator:robotspacer
Number:rdar://20248565 Date Originated:21-Mar-2015 01:49 AM
Status:Open Resolved:
Product:iOS SDK Product Version:Xcode 6.2 (6C131e) with iOS 8.2, and Xcode 6.3 (6D543q) with iOS 8.3 beta 3
Classification:UI/Usability Reproducible:Always
 
Summary:
I can't find a way to use UISearchController and UISplitViewController together that doesn't result in serious display bugs after rotation. The problems are especially bad when scopeButtonTitles are provided. These problems mainly affect iPhone 6 Plus, but they can also affect other devices if traits are overridden--for example in one of my own apps I support a split view in landscape on iPhone 6.

Steps to Reproduce:
1. Run the attached project on an iPhone 6 Plus (device or simulator).
2. Tap the + button at least once to add a row.
3. Tap in the search bar.
4. Type any search text.
5. Tap on a row in the table.
6. Rotate the device more than once. Certain patterns will always trigger the bug. For example in the simulator, starting in portrait: command-right arrow, command-left arrow, then command-right arrow again. Or just rotate in the same direction 5 times.

Expected Results:
The search bar should display the same as it does when the device is first rotated into landscape. It should not overlap the scope bar, or have blank space underneath it.

Actual Results:
The search bar overlaps the scope bar. There is a blank space below them where the scope bar would normally be. In some cases there is empty space above the search bar as well, as though it expects the status bar to be there. (This should happen if you start the search in landscape and then rotate.)

Version:
Xcode 6.2 (6C131e) with iOS 8.2, and Xcode 6.3 (6D543q) with iOS 8.3 beta 3

Notes:
The only partial workaround I've found is to override viewDidLayoutSubviews and add [self.searchController.searchBar sizeToFit]. This just makes the problem less severe though—if I search, select rows, and rotate enough it will still mess up the table view, even after dismissing the search. It ends up in a state where the search bar is permanently overlapped by the navigation bar, making it difficult or impossible to use.

Configuration:
iPhone 6 Plus

Attachments:
'ScopeBar.zip' was successfully uploaded.

Comments

Here's another sample project that shows the same problems: https://github.com/kharrison/CodeExamples/tree/master/WorldFacts

By robotspacer at March 21, 2015, 5:52 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!