首页 > 其他 > 详细

UITextInputMode

时间:2017-01-14 11:26:39      阅读:289      评论:0      收藏:0      [点我收藏+]

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!