landonandrey
landonandrey

Reputation: 1341

How to show list of keyboards

I have created my own custom keyboard and I want to show list of keyboards view as Apple does. How can I reach this?

enter image description here

Upvotes: 1

Views: 485

Answers (2)

Damien Rottemberg
Damien Rottemberg

Reputation: 195

Yes it's possible since iOS 10

If you have an UIButton called nextKeyboardButton just add that in your viewDidLoad function.

nextKeyboardButton.addTarget(self, action: #selector(handleInputModeList(from:with:)), for: .allTouchEvents)

handleInputModeList is part of UIInputViewController

Upvotes: 2

jcaron
jcaron

Reputation: 17710

This is not possible.

Apple documentation for developing custom keyboards says (emphasis mine):

To ask the system to switch to another keyboard, call the advanceToNextInputMode method of the UIInputViewController class. The system picks the appropriate “next” keyboard; there is no API to obtain a list of enabled keyboards or for picking a particular keyboard to switch to.

Note that you must provide a way to get to the next keyboard using the above method.

Upvotes: 1

Related Questions