Fix the color the passwords

- in the password editing view
- color of some characters
This commit is contained in:
Yishi Lin 2017-03-24 01:34:45 +08:00
parent 2899f05a73
commit ca66cd8e6c
3 changed files with 9 additions and 1 deletions

View file

@ -133,7 +133,7 @@ class Utils {
for (index, element) in plainPassword.unicodeScalars.enumerated() {
if NSCharacterSet.decimalDigits.contains(element) {
attributedPassword.addAttribute(NSForegroundColorAttributeName, value: Globals.red, range: NSRange(location: index, length: 1))
} else if NSCharacterSet.punctuationCharacters.contains(element) {
} else if !NSCharacterSet.letters.contains(element) {
attributedPassword.addAttribute(NSForegroundColorAttributeName, value: Globals.blue, range: NSRange(location: index, length: 1))
}
}