How can an iOS app know if a keyboard is already on the screen when the app opens? Once an app is running, it can receive keyboard show/hide notifications. But if the app opens as a secondary app in Split Screen mode while the primary app already has a keyboard showing, the secondary app does not receive any notifications to tell it to adjust its views for the keyboard. And as far as I can tell, these notifications are the only way to tell if a keyboard is showing and what its frame is, to then obtain the necessary layout constraints. Is there a way to get this information, or should a bug report be filed for this issue?
How can an iOS app know if a keyboard is already on the screen when the app opens (iOS Multitasking)
Asked
Active
Viewed 1,659 times
4
-
1Questions like this is what StackOverflow is about. I like it. – quemeful May 17 '16 at 20:33
-
Have you found a solution? – Azat Aug 27 '16 at 16:40
-
No, I'm sorry, I haven't found a solution. I've tabled the issue for now. – SAHM Aug 27 '16 at 16:41
1 Answers
0
There is currently no way to detect if another app has the keyboard focus.
You might be able to make a workaround using Auto Layout though.
-
It looks from my feed that you might have started to answer this by saying that the keyboard is auto-hidden each time the app goes into split screen mode. I see the beginning of that answer in my feed but I can't find the answer on this page. Is that the case? – SAHM May 17 '16 at 20:46
-
The keyboard is auto hidden, but if the keyboard was active in the first app, it will come back (still active in the first app) once the second has loaded. I just tried it on the iPad Pro simulator in XCode. – quemeful May 17 '16 at 20:48
-
-
I don't see how it could. The notification, if any, would go to where the keyboard has focus (the app that was open already) – quemeful May 17 '16 at 20:50
-
check this out http://stackoverflow.com/questions/4374436/how-to-detect-when-keyboard-is-shown-and-hidden – quemeful May 17 '16 at 20:50
-