Review WWDC 2018 Session 204 - Automatic Strong Passwords and Security Code AutoFill.
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
The operating system will detect verification codes from Messages automatically (messages that contain the word "code" or "passcode") with this UITextContentType
set.