UISearchDisplayController changes it's UISearchBar superview

Originator:shnhrrsn
Number:rdar://15142242 Date Originated:10/3/2013
Status:Open Resolved:No
Product:iOS SDK Product Version:7.0
Classification:Serious Bug Reproducible:Yes
 
Summary:
In iOS 7, if a UISearchBar is in a UIScrollView view hierarchy, but not added directly to a UIScrollView, UISearchDisplayController will change it's superview to be the UIScrollView when search is dismissed.  In iOS 6 and previous versions, the superview remains consistent.

iOS 6 Log:

12:06:32.360  loadView - searchBar.superview: <UIView: 0x76742e0; frame = (0 0; 0 0); layer = <CALayer: 0x7673f30>>
12:06:39.494  searchDisplayControllerWillBeginSearch: - searchBar.superview: <UIView: 0x76742e0; ...>
12:06:39.813  searchDisplayControllerDidBeginSearch: - searchBar.superview: <UIView: 0x76742e0; ...>
12:06:40.593  searchDisplayControllerWillEndSearch: - searchBar.superview: <UIView: 0x76742e0; ...>
12:06:40.859  searchDisplayControllerDidEndSearch: - searchBar.superview: <UIView: 0x76742e0; ...>


iOS 7 Log:

12:07:04.549  loadView - searchBar.superview: <UIView: 0x8c6e070; ...>
12:07:07.122  searchDisplayControllerWillBeginSearch: - searchBar.superview: <UIView: 0x8c6e070; ...>
12:07:07.624  searchDisplayControllerDidBeginSearch: - searchBar.superview: <UIView: 0x8b79300; ...>
12:07:08.006  searchDisplayControllerWillEndSearch: - searchBar.superview: <UIView: 0x8b79300; ...>
12:07:08.263  searchDisplayControllerDidEndSearch: - searchBar.superview: <UIScrollView: 0x8c642d0; ...>

Steps to Reproduce:
1. Create a container view for UISearchDisplayController's search bar
2. Add the search bar to the container view
3. Add container view to a UIScrollView
4. Monitor the search bar superview

Expected Results:
The search bar's superview should never change.

Actual Results:
In iOS 7, the superview changes when search is dismissed.

Attachments:
http://cl.ly/2Y3N1y2z2A2v

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!