iOS keyboard mapping for testing multiple keyboard layouts - ios

I am trying to write a automation script to test for keyboard mapping for multiple keyboard layouts on my ipad/iphone app.
type all the characters from current keyboard layout (ex English keyboard layout) , next change the keyboard layout to French and type all the keys on the keyboard layout.
i tired to use myapp.keys["a"].tap() and it types character "a" on my app
next if i try same myapp.keys["a"].tap() on a French keyboard layout again character "a" is typed on my app.
But this does not help me in testing for any keyboard mapping issues coz myapp.keys["a"] searches for "a" anywhere in the keyboard and types it.
Instead i want to test if the character "a" exists on the first row for French keyboard and on English keyboard character "q" exists.

Related

UIKeyboardType.numberPad is always english

I'm trying to make my app accessible with Voice Over. On one of the screens I have a text field for entering number. Nothing special, just default UITextField with keyboardType set to UIKeyboardType.numberPad. Voice Over is actually working well and read all selected keyboard buttons. The problem is that keyboard is always english (with english letters under digits). And when you switch iPhone language to something other than english, Voice Over mixes two languages:
When you select digit on keyboard with single tap, Voice Over read it in current iPhone language (russian in my case)
When you double tap (to enter digit into text field), Voice Over always read it in english
What I changed in setings:
Set iPhone language to russian
Set region to russia (not sure if it matters at all)
In "General -> Keyboard -> keyboards" moved russian keyboard to the top of the list
But nothing helped. UIKeyboardType.numberPad and UIKeyboardType.decimalPad are always english (UIKeyboardType.default is russian as it should be)
Am I missing something?
I also tried to change keyboard language programmatically - iPhone: Change Keyboard language programmatically. But that didn't work either.
It's confusing for sure, but it sounds like your app is not actually localized for Russian. Try localizing it and see if that improves things.

How can I force/setup the right keyboard in the iOS Simulator during tests?

The app has a Chinese localization and runs with Scheme options (see image).
When I hit the text field, I would expect a Chinese keyboard and not a German one.
I only see German, English and Emoji keyboards.
Is there any way to tell the Simulator which keyboard should be used by default?
Unfortunately, this is not automatic. You should manually add a Chinese keyboard and make it the default.
Navigate to Settings/Keyboards, add the Chinese keyboard under Keyboards and drag it to the first place of the list after clicking on Edit.

Remove letter upper form keyboard

Is it possible to remove letter upper from keyboard ?
Not if its the standard UIKeyboard. You can roll your own keyboard that does not support uppercase. Alternatively, for an easier solution you can make all text lowercase when entered via a bit of code.
You can create your Custom Keyboard with iOS8 App Extension. Try this tutorial :
http://www.appcoda.com/custom-keyboard-tutorial/
Also check at developer.apple.com :
https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/Keyboard.html
A custom keyboard replaces the system keyboard for users who want
capabilities such as a novel text input method or the ability to enter
text in a language not otherwise supported in iOS. The essential
function of a custom keyboard is simple: Respond to taps, gestures, or
other input events and provide text, in the form of an unattributed
NSString object, at the text insertion point of the current text input
object.

International keyboard crashing the app on the device

I have a problem when testing the app I wrote on the iPhone where I have set up an international keyboard.
The iPhone remembers the last input layout I used (i.e when I'm in messages and I'm using the hebrew keyboard, the next time I will use the keyboard in another app the hebrew layout will appear first) so when I'm running the app on the device and trying to input text into a textfield, the cursor appears but the keyboard doesn't, and any attempt to touch anywhere in the app causes a "Thread 1:EXC_BAD_ACCESS (code=1,address=0x14).
In addition, when the last layout I used is the english one, the app running perfectly even when I'm switching to the hebrew one.
I just noticed that it happens only with the "Name Phone Pad" keyboard, is there anyway to use this keyboard with international one?
Thanks!
My best guess is that you have a delegate that's intercepting key strokes. I reccomend you either specify the first responder per textfield and see if that works or else localize the file for english (or whatever language) only.

How do I enable the Japanese keyboard on the iPhone simulator?

I have a UITableview with a UISearchBar, which contain Japanese words, and I want to test if it works to search Japanese words with Japanese keyboard. I can't find how to change the default keyboard on iPhone simulator.
Open on simulator Settings application ->General->International->Language. Select here your language and keyboard will have required letters.
I think what we really want to do is add an international keyboard, not change the language of the simulator.
Open Simulator
Find Settings. It's an app, not a menu item. Look for the icon with three gears.
Navigate to General > Keyboard > International Keyboards > Add New Keyboard
Now select the international keyboard(s) you'd like to add.
You can access the new keyboard(s) in your app by clicking the button that looks like a globe.
Once selected, that keyboard will remain the default until you change it again using the method from step 5.
Note that for Japanese (and Chinese) the keyboard layout isn't that important; what is needed is an input module converting the input to actual ideographic characters. Those are called "IME" (Input Method Editor)
A keyboard has just about a hundred keys, only half of them being alphabetic; but Japanese and Chinese need several thousands different characters. The role of IMEs are to convert phonetic of descriptive input into the wanted characters.
Japanese keyboard provides direct typing of phonetic japanese characters (katakana and hiragana); but all japanese IMEs acccept phonetic input either in native kana or in romanized (in latin letters).

Resources