0

First of all I'm not looking for code or how to do it, just the process.

I don't fully understand how Custom Keyboards work in iOS8-up and I would like to include a simple custom numeric keyboard in my app. In the past I have created static keyboards with multiple UIButtons which are visible all the time, this time however I want a custom 9 digit keyboard with the same behavior as one of the default keyboards in iOS, in other words, the keyboard will show when a UITextField is tapped and hide when the resignFirstResponder method is called. I want this to be the default and ONLY keyboard used in my app.

What are my alternatives to adopt the behavior described above?

Do I need to create a Custom Keyboard extension?

Can someone describe the process to include a custom keyboard that acts as the default keybaord WITHIN your app?

Again I'm not looking for how to do it just the process.

Thanks

fs_tigre
  • 10,650
  • 13
  • 73
  • 146
  • 1
    "the default and ONLY keyboard" sounds like you want to change the inputView, rather than use the custom keyboard (or the user will be able to change to other system keyboard) – zc246 Feb 18 '16 at 13:39
  • No I don't want to allow the user to use other keyboards. – fs_tigre Feb 18 '16 at 13:41
  • 1
    Set the `inputView` of your own textView & textField, and use them everywhere in your UI. – zc246 Feb 18 '16 at 14:24
  • @ zcui93 -This is exactly what I was looking for. Quick question, If I understand this correctly and by looking at the documentation I would need to assign my custom keyboard view to each textField where I want to use my custom keyboard, something like...`myTextField.inputView = myCustomKeyboardView`, correct? If yes, do I need to do this in my `viewDidLoad` method? – fs_tigre Feb 18 '16 at 15:48
  • 1
    Normally you would do it in `viewDidLoad`, so yes. However, you may want to write you own inherited `textField` class with the `inputView` set up to be used everywhere. (I didn't actually try it yet, but I believe it will work. The tricky part would be determining the width and height for the input view. Maybe have a method to setup the size properly in `viewDidLoad`) – zc246 Feb 18 '16 at 21:18
  • 1
    Quick update, according to [this](http://stackoverflow.com/questions/6042060/custom-keyboard-inputview-how-to-change-the-keyboard-size) The size of the custom inputView would not be a problem. – zc246 Feb 18 '16 at 21:41
  • Now, does the view containing the custom keyboard need to be done programmatically? – fs_tigre Feb 18 '16 at 23:09
  • 1
    Either. It's just a `UIView`, so programmatically or from nib file are both fine. – zc246 Feb 19 '16 at 09:05
  • I will give it a try and let you know how that goes since this will be my first time `subclassing` and using `.xib` files. Thanks a lot for your help. – fs_tigre Feb 19 '16 at 13:32
  • No problem. Cheers :) – zc246 Feb 19 '16 at 13:38

0 Answers0