码迷,mamicode.com
首页 > 其他好文 > 详细

UITextInputMode

时间:2017-01-14 11:29:06      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:lang   ref   nts   通知   返回值   repr   输入法   href   http   

An instance of the UITextInputMode class represents the current text-input mode. You can use this object to determine the primary language currently being used for text input.

既表示当前文本输入模式的一个类,可以用它来确定当前输入的语言

  • 确定textfiled的正在输入的语言

    myTextField.textInputMode?.primaryLanguage
    

    返回值是一个BCP 47 language code中一个。如"en", "en-US"
    BCP47

  • 判断切换输入法

    监听UITextInputCurrentInputModeDidChange通知。

UITextInputMode

标签:lang   ref   nts   通知   返回值   repr   输入法   href   http   

原文地址:http://www.cnblogs.com/huahuahu/p/UITextInputMode.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!