I have a calculator app that can be operated by tapping simulated keys on the screen, or by pressing keys on a connected Bluetooth keyboard. I'm getting events from the Bluetooth keyboard by implementing canBecomeFirstResponder and pressesBegan/pressesEnded on my main view, and calling becomeFirstResponder when the view is activated.
This works fine, except in one scenario: when the app is running in Split View mode on an iPad, and another app has an active text field, then my app isn't getting keyboard events, after switching to it by tapping on it or pressing Cmd-Tab. I have to go into the other app and explicitly deactivate the text field, by clicking somewhere outside of it, or by pressing Esc on the Bluetooth keyboard.
I noticed that when there are two apps, both with text fields, then activating a text field in one app will automatically deactivate the active text field in the other app, if there is one.
In other words, UITextField appears to be capable of stealing the input focus from a text field in another app. How can I achieve this without using a UITextField?