I have a Text Field and I would like to replace the default dot character to something else when the password is hidden. Is there any way to do this easily?
What Are The Dots When You Type In Your Password? The dots you see when you type in your passwords are called “masking.” The purpose of the dots is to hide your password as you type each letter. Each dot represents a character you type, but that is the only thing known about the password.
How do you make a text field Uneditable in Swift? Within code: textfield. enable = false.
2 options here:
Here's the code (will show the password as $$$$):
var password: String = ""
func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool
{
password = password+string
textField.text = textField.text+"$"
println("\(password)")
return false
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With