Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically change keyboard in iOS?

Tags:

ios

keyboard

I would like to programmatically change keyboard when I click a button event.

I used custom keyboard in my app, but I need to change English (US) keyboard in programmatically when I click a button on my custom keyboard.

like image 298
Fire Fist Avatar asked Nov 04 '22 19:11

Fire Fist


1 Answers

The only way you can control the keyboard is by showing it (By setting a UITextView/UITextField as a first responder), hiding it (by resigning the editing Easy way to dismiss keyboard?).

The language of the keyboard cannot be changed by your app, since it is a user preference. If you want a custom keyboard of your own, you would have to design it yourself (with UIButtons) and obviously also program it (when it shows, when it hides. I would simply use the keyboard that the user prefers, why do you need to change it? After all, the user is the one that decides which keyboard he uses.

like image 96
Jorge Aguirre Avatar answered Nov 07 '22 08:11

Jorge Aguirre