I have an app which asynchronously searches a remote API and displays the UI using iOS' UISearchDisplayController.
For a saved search feature, I've been trying to programmatically use the UISearchDisplayController, in order to both initiate the search, and set up the user interface to be right back where he used to be. (Ie., I'm trying to bring up the search bar and set the search term.)
searchTableViewController.searchDisplayController.searchBar.text = mySearchTerm;
//[...]
[searchTableViewController.searchDisplayController setActive:YES animated:YES];
[searchTableViewController performSearch];
The code I've tried so far—above—doesn't seem to do the trick. While it correctly brings up the search bar, sets the search term and performs a search, the system doesn't seem to recognize this as a valid search somehow. If I use my fingers in the results view to make the keyboard disappear, the search term resets itself and the results disappear.
Help appreciated. Thanks!