UITabBarController fails to restore a tab when UISearchController's search bar is active

Number:rdar://32265769 Date Originated:May 18 2017
Status: Resolved:
Product:iOS + SDK Product Version:10.3
Classification:Serious Bug Reproducible:Always
I have an app with a Tab Bar Controller with two tabs. In each tab is a Navigation Controller with a root view controller. One of the root view controllers has a UISearchController and adds the search controller's search bar to its view. If I navigate away from the tab with the search bar whilst the search controller is active then the tab's contents is missing when I navigate back.

Steps to Reproduce:
1. Open the included project in Xcode.
2. Run the app.
3. Navigate to the 2nd tab.
4. Tap on the search field.
5. Type the letter 'a'
6. Tap the 'Search' key on the keyboard to dismiss the keyboard
7. Navigate to the 1st tab
8. Note that the SearchViewController's 'viewWillDisappear' and 'viewDidDisappear' aren't called
9. Navigate back to the 2nd tab
10. Note that the view is missing and there is a black rectangle instead.

Expected Result:
I'd expect that the SearchViewController's  'viewWillDisappear' and 'viewDidDisappear' were called.
I'd expect to see the 2nd tab's view when I navigate back to it.

Actual Result:
The SearchViewController's  'viewWillDisappear' and 'viewDidDisappear' aren't called.
The view is missing when I navigate back to the 2nd tab.


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!