How to show verification code suggestion on keyboard from Message

后端 未结 4 1641
清歌不尽
清歌不尽 2020-12-25 14:10

I watched this video What\'s New in Cocoa Touch at WWDC 2018 and seen:

How to show this information?

4条回答
  •  梦毁少年i
    2020-12-25 14:41

    iOS supports Password AutoFill on UITextField, UITextView, and any custom view that adopts the UITextInput protocol. System keyboard set the textContentType on it to .oneTimeCode

    singleFactorCodeTextField.textContentType = .oneTimeCode
    

    Important

    tvOS apps can also support Password AutoFill using the same content-type settings. The AutoFill QuickType bar appears above the keyboard when entering passwords with an iOS device using the Control Center keyboard, the Remote app, or the Continuity Keyboard. Focus is also advanced to the login button when the login fields are populated.

    Warning

    If you use a custom input view for a security code input text field, iOS cannot display the necessary AutoFill UI.

提交回复
热议问题