Quantcast
Channel: iPhone: Change Keyboard language programmatically - Stack Overflow
Viewing all articles
Browse latest Browse all 8

Answer by kotvaska for iPhone: Change Keyboard language programmatically

$
0
0

I know it is old question, but here it is my way to change keyboard language.

Thank to @the4kman for the mark: this way can change current keyboard only to those which were added in Settings.

Swift 3:

class CustomTextField: UITextField {    private func getKeyboardLanguage() -> String? {        return "en" // here you can choose keyboard any way you need    }    override var textInputMode: UITextInputMode? {        if let language = getKeyboardLanguage() {            for tim in UITextInputMode.activeInputModes {                if tim.primaryLanguage!.contains(language) {                    return tim                }            }        }        return super.textInputMode    }}

Viewing all articles
Browse latest Browse all 8

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>