Specify colors for digits and letters in password
This commit is contained in:
parent
f3551a1542
commit
6ea47766bc
2 changed files with 4 additions and 2 deletions
|
|
@ -107,9 +107,9 @@ public class Utils {
|
|||
for (index, element) in plainPassword.unicodeScalars.enumerated() {
|
||||
var charColor = UIColor.darkText
|
||||
if NSCharacterSet.decimalDigits.contains(element) {
|
||||
charColor = Globals.red
|
||||
charColor = Globals.digitColor
|
||||
} else if !NSCharacterSet.letters.contains(element) {
|
||||
charColor = Globals.blue
|
||||
charColor = Globals.letterColor
|
||||
}
|
||||
attributedPassword.addAttribute(NSAttributedStringKey.foregroundColor, value: charColor, range: NSRange(location: index, length: 1))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue