I've installed Swift Keyboard in my phone 5s with iOS 8.
The original method (Objective-C) to obtain the keyboard size only works with the system keyboard, for example:
- (void)keyboardWillShow:(NSNotification *)notification
{
CGSize keyboardSize = [[[notification userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
}
If I use Swift Keyboard... keyboardSize.height is zero. How to get third-party keyboard size in iOS 8?
Thanks.
I think that's because you're getting the size before the keyboard has actually been displayed.
Try replacing:
objectForKey:UIKeyboardFrameBeginUserInfoKey
With:
objectForKey:UIKeyboardFrameEndUserInfoKey
This is working for me with SwiftKey!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With