Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple keyboard layouts in an iOS keyboard extension

I'm currently working on a keyboard extension for iOS, and am now wondering how to integrate multiple layouts support into the system settings.

In the system settings, the default en_US keyboard has an additional menu (indicated by a arrow to the right), where you can choose from multiple keyboard layouts, as you can see in the screenshot from the iOS simulator below (iOS 9.1 13B137)

enter image description here

Can this be achieved with a custom keyboard extension, too? I can't find any documentation on it. (Which may mean that it either isn't possible using public APIs or I am too stupid to use Google.) I've searched quite a lot online, but most of what I find is about setting the keyboard locale in the Info.plist file or instructions on how to enable the system keyboard in different languages (which are registered as different keyboards), which I would like to avoid.

I can see an alternative, if this doesn't work, which would be to basically create multiple keyboard extensions in one wrapping app, which include the same code base, but define other layouts. However, this would look rather ugly, clutter up the code, and people will have to enable each layout individually, which, from my point of view, isn't the most user-friendly approach. As stated above, iOS ships with different keyboards for different languages, but I'm trying to provide multiple keyboard layouts for the same language, so this is not what I want.

like image 682
s3lph Avatar asked Nov 04 '15 18:11

s3lph


1 Answers

This doesn't appear to be directly supported. Like you said, other third-party keyboards are stepping around this issue by providing alternate keyboard layouts as a function within the keyboard itself.

For example, Swype allows QWERTY/AZERTY/QWERTZ layout changes by long-pressing on the spacebar.

like image 102
Chris Droukas Avatar answered Oct 21 '22 15:10

Chris Droukas