iPhone: Why does the keyboard language switch randomly? Currently on my iPhone (current iOS, but this has been an issue since long ago), the keyboard language switches randomly between English and Chinese, every time I go to a new app or an input field.

There doesn't seem to be a pattern, like what was the input language when I last used the app. Sometimes it appears to switch to a different language even for the same app (e.g. Safari) when I switch somewhere else and switch back. I have 3 input languages installed: English, Simplified Chinese and Emoji. Though the input never defaults to Emoji.

Any idea what is going on? Are there any fixes?
What you are observing is not really random. It is programmatically possible to remember the last used keyboard language, from among the set of languages chosen by user under Settings app → General → Keyboard → Keyboards, on a per text input field basis. This is employed by apps which present multiple text entry fields (such as messaging apps) to automatically choose the last used or the most relevant language.

Let me explain it with the help of an example. Suppose in a messaging app, you prefer conversing with some users in Simplified Chinese and with some in English. It's possible to program the app so that a text input field remembers the last used keyboard language. This way, the last chosen language is automatically selected for you. However, this doesn't work with the Emoji keyboard. This approach can be taken to aid user convenience.

If you are interested in learning about the programming aspect of how this can be achieved, refer to this answer on Stack Overflow:


https://stackoverflow.com/a/23403247/6995250