Set a PasswordField to secureTextEntry give me a strange behaviour

后端 未结 7 2017
感动是毒
感动是毒 2021-01-07 18:01

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

7条回答
  •  天命终不由人
    2021-01-07 18:19

    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
    }
    

提交回复
热议问题