As you all might be knowing about the new Quick Type bar on the keyboard.
In my application , I have put a custom TextView bar on the keyboard. But because of QuickType Bar , my textview gets hidden.
I want to know , Is there any property or method to know whether the QuickType Bar is open or not ?
There is nothing which can tell you whether the QuickType bar is active or not but you can register for the
UIKeyboardWillChangeFrameNotification
notification with this code and with that you can get info about the height of the keyboard.Use the
UIKeyboardFrameBeginUserInfoKey
andUIKeyboardFrameEndUserInfoKey
values in the passeduserInfo
dictionary to retrieve the current and future frames of the keyboard. You can use the following code as a reference.Hope this helps. It will get called every time the keyboard changes its frame.
As the other answers have suggested, the
UIKeyboardWillChangeFrameNotification
will fire every time the keyboard gets a new frame. This includes when the keyboard will show and hide, and when the QuickType bar will show and hide.The thing is, this is exactly the same notification as the
UIKeyboardWillShowNotification
, just with a different name. Therefore, if you're already implementing a method for theUIKeyboardWillShowNotification
, you're good to go.With one exception, though. When you get the keyboard frame in your method for handling the
UIKeyboardWillShowNotification
, you must make sure you access it via theUIKeyboardFrameEndUserInfoKey
, not theUIKeyboardFrameBeginUserInfoKey
. Otherwise, it will get the correct frame when the keyboard is shown/hidden, but not when the QuickType bar is.So, the code in your method for handling the
UIKeyboardWillShowNotification
should look something like this (in Swift):