The pair of UIViewController and UISearchController dances funky

Originator:daniel
Number:rdar://21767974 Date Originated:2015-07-10
Status:Open Resolved:
Product:iOS Product Version:iOS 8.4 (12H143)
Classification:UI/Usability Reproducible:Always
 
Summary:
This one doesn’t come with a sample project, but with references to the stock apps that ship on iOS 8:

There’s a caching bug in UIViewController’s code that lays out UISearchController’s view which causes weird misplacements during rotation.

In Mail.app, for example, try tapping “search” while you’re in portrait — do not type anything — rotate to landscape*, cancel search.

You will see the UIRefreshControl through a gap that’s as high as the status bar.

*this is already off: the search bar still leaves space for the status bar, but that’s been animated away. If you start in landscape, this part is fine, but if you rotate to portrait, the search bar now underlaps the status bar.

In Messages.app, the problems are a bit less obvious: you have to actually search for anything, select one result, then rotate and navigate back to the search results to see the search bar underlapping the status bar.

Note, that the problem persists until you cancel the search.

If you do so in portrait, the search bar animates down smoothly to a position that is offset towards the top by the height of the status bar, and at the end of the animation “jumps” to its final, albeit correct, position.

Steps to Reproduce:
See above

Expected Results:
- In the Mail example, the search bar looks the same in landscape, regardless which route lead you there.
- rotating does not lead to misplacements: the bar sits snuggly at the top
- the search bar’s text field *never* underlaps the status bar
- in the messages example, the search bar animates smoothly to its final position

Actual Results:
See in description

Version:
iOS 8.4 (12H143)

Notes:
This is known to be a duplicate of rdar://21743785 which is way more technical.
This one here just adds more samples.

Configuration:
Any iPhone or simulator running iOS 8.4 will do

Attachments:

Comments


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!