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

Answer by Au Ris for iPhone: Change Keyboard language programmatically

$
0
0

All great answers. But in Swift you can override methods and variables defined in parent class (UIResponder) in an extension. So it's not necessary to subclass. And it's nice to replace the for loop with a more swift like one-liner.

public extension UITextField {      override var textInputMode: UITextInputMode? {        return UITextInputMode.activeInputModes.filter { $0.primaryLanguage == "emoji" }.first ?? super.textInputMode    }}

Instead of "emoji" probably will be something like Utils.currentAppLanguage


Viewing all articles
Browse latest Browse all 8

Trending Articles