0

I am working on custom keyboard extenssion for iOS. The keyboard's size should match that of default system keybaord on each device.

For purposes of accompanied app I need to know what is the size of default system keyboard (in portrait and landscape) without actually displaying the keyboard. Is there a way?

Sure, I can measure size of keyboard in simulator on all devices a and than just use it as constant. But then if a new device is released the app will not work on it properly - its keyboard size will not be amoung constants.

Rasto
  • 17,204
  • 47
  • 154
  • 245

2 Answers2

0

Having never created a Keyboard Extension myself I'm going off of what would make sense to me. I would recommend coming up with a layout for your keyboard that is consistent and have auto layout resize it to fill the space. If you're not using Interface Builder I'd recommend checking your view (or superview) in viewDidLoad and seeing if it has already been sized for you.

InkGolem
  • 2,662
  • 1
  • 15
  • 22
  • In `viewDidLoad` the size is `0,0`, so it is in `viewWillAppear`. But again - I want to use the size in the compation app not in the extenssion itself. In the app, the keyboard will never show, what does it help me if get the size once it is shown?? – Rasto Dec 02 '14 at 00:27
0

No, the keyboard size can't be determined without actually showing it. In any app, the current keyboard size should be determined by UIKeyboardFrameBeginUserInfoKey in a notification observer each time notified by UIKeyboardDidShowNotification.

NeonBerry
  • 372
  • 2
  • 6