0

I have one question, may be it is very simple, but I do not know about this nothing... For example, I have an application, application with textfield, I want to know two things.
First: Is possible to switch keyboard when application in runtime?
Second: how I can switch type of keyboard(Russian, English, Swedish, etc.) in my application*?

*-without going to Settings->General->Keyboard->add new keyboard.

Invader
  • 23
  • 10

1 Answers1

0

Not sure about changing languages (I did find this other post about it: change input source language programmatically OSx), but changing the keyboard is pretty easy. Here is a one line example:

textField.keyboardType = UIKeyboardTypeURL;

Take a look at the UITextInputTraits protocol reference for more info. Then the question comes in where to implement this. I am assuming that you want to check conditions right before the keyboard comes up, you may have to implement UITextFieldDelegate protocol (and maybe using the field's tag to see which field the cursor is in).

Hope this helps.

Community
  • 1
  • 1
Steve Yung
  • 68
  • 5