Getting the currently active keyboard language as NSLocale

后端 未结 1 1599
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-27 08:51

I already found a lot of approaches for this but no working solution. Here\'s what I tried and didn\'t work.

(1) Simply calling primaryLanguage()

<
相关标签:
1条回答
  • 2021-01-27 09:46

    You can access the primaryLanguage from every textfield by accessing the textfields textInputMode like that:

    var language = textfield.textInputMode?.primaryLanguage
    
    0 讨论(0)
提交回复
热议问题