Search code examples
iosswiftiphonesecurityipad

Obscure a UITextField password


I am doing a login page. I have UITextField for password.

Obviously, I do not want the password to be seen; instead, I want circles to show when typing. How do you set the field for this to happen?


Solution

  • Please set your UItextField property secure..

    Try this..

    textFieldSecure.secureTextEntry = true
    

    textFieldSecure is your UITextField...

    For newer Swift version, it is textFieldSecure.isSecureTextEntry = true