There is no way to hook into the search provided by UIDocumentBrowserViewController (or disable it)

Originator:steipete
Number:rdar://33004145 Date Originated:27-Jun-2017 04:05 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:iOS 11b2
Classification:Enhancement Reproducible:Always
 
Summary:
UIDocumentBrowserViewController shows a UISearchBar by default and allows to search for documents by title, which is great. CoreSpotlight allows us to index the contents of documents, which allows Users to even search for documents by their content (Full-Text-Search). 

The functionality to search documents by content is lost, when the search within the UIDocumentBrowserViewController is used, and there is no way to hook into this system and provide your own search results. This is bad for consistency, since the search behaves differently when it's triggered via Spotlight and when it's triggered in-app. Moreover, since the default search can't be disabled there is also no sane way to provide your own Search UI in the app, which would allow for using CoreSpotlight to search by document content. Of course it would be possible to specify an additional bar button item to provide a ViewController with enhanced search capabilities, but 2 different ways to trigger search within an app would be very confusing to the user.

Steps to Reproduce:
1. Open the attached DocumentBrowser-based app
2. Create a document by tapping on "New Document"
3. Edit the document content and enter the text "Lorem Ipsum"
4. Close the document
5. Tap on the search bar and search for "Lorem"

Expected Results:
The document with the content "Lorem Ipsum" shows up, if CoreSpotlight is used to index

Actual Results:
The document doesn't show up, the search is only performed by document title

Version:
iOS 11b2

Notes:

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!