如何在Message上的键盘上显示验证码建议 [英] How to show verification code suggestion on keyboard from Message
本文介绍了如何在Message上的键盘上显示验证码建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我观看了此视频在WWDC 2018上可可触摸的新功能,见过:
I watched this video What's New in Cocoa Touch at WWDC 2018 and seen:
如何显示此信息?
推荐答案
评论 WWDC 2018会话204-自动强密码和安全代码自动填充.
您将需要使用UITextField
进行输入和系统键盘(无自定义控件),并将其上的textContentType
设置为.oneTimeCode
(iOS 12中的新增功能).
You will need to use a UITextField
for entry and the system keyboard (no custom controls) and set the textContentType
on it to .oneTimeCode
(new in iOS 12).
let securityCodeTextField = UITextField()
securityCodeTextField.textContentType = .oneTimeCode
设置了UITextContentType
的操作系统将自动从消息中检测验证码(包含单词"code"或"passcode"的消息).
The operating system will detect verification codes from Messages automatically (messages that contain the word "code" or "passcode") with this UITextContentType
set.
这篇关于如何在Message上的键盘上显示验证码建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文