I have a passwordField who i set the isSecureTextEntry to true, for hidden the characters. But when I click to this passwordField this show me this
isSecureTextEntry
passwordField
I borrowed @Hamid Reza Ansari's answer above, but also had to support older iOS versions, so wrapped it in a condition:
if #available(iOS 12.0, *) { self.textContentType = .oneTimeCode }