I'm working on adding support for keyboard shortcuts into my iOS app. It is made of a UISplitViewController, and the shortcuts are provided by its detail view controller. The master is composed of a view controller with a UITableView and UISearchBar as table view header (using a UISearchController).
While it works great when I do showDetailViewController, I realized that in many scenarios, the detail view controller loses first responder, and thus shortcuts no longer work.
Examples where first responder is lost:
- After a search (
UISearchBarmomentarily took first responder) - After opening a second app in multitasking (split view) and closing it
My problem seems to that be the detail view controller loses first responder and doesn't get it back.
Reading the documentation I've seen that I could override nextResponder in all responders so that they designate the detail view controller. But this seems overkill as there are many of these potential responders...
What do you think is the best approach / practice to solve this problem?
Thanks for your help!