Reputation: 21
I am using the code below:
CGRect keyboardFrame = [[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
but it doesn't work exactly.
Upvotes: 2
Views: 1357
Reputation: 4302
When switching to emoji keyboard by pressing the language selector button (the globe), it seems that a UIKeyboardWillChangeFrame
-notification gets sent. But when changing by long pressing the language selector button, no notification is sent.
It looks to me as a bug in iOS 11, since even the apple messages app and facebook messenger app doesn't handle this right. I've submitted a radar about this with id: 36657137
Upvotes: 2
Reputation: 5066
You can subscribe to notifications: UIKeyboardWillChangeFrame or UIKeyboardDidChangeFrame . In handlers you can get the end frame of the keyboard.
Here I’ve created an example application.
Upvotes: 4