Adapt UI with respect to Dark Mode

This commit is contained in:
Danny Moesch 2019-09-22 16:16:51 +02:00 committed by Mingshen Sun
parent 35bac7260b
commit 414e31cba3
7 changed files with 24 additions and 25 deletions

View file

@ -22,11 +22,11 @@ public class Utils {
for (index, element) in plainPassword.unicodeScalars.enumerated() {
var charColor = UIColor.darkText
if NSCharacterSet.decimalDigits.contains(element) {
charColor = Globals.digitColor
charColor = Globals.red
} else if !NSCharacterSet.letters.contains(element) {
charColor = Globals.symbolColor
charColor = Globals.blue
} else {
charColor = Globals.letterColor
charColor = Globals.black
}
attributedPassword.addAttribute(NSAttributedString.Key.foregroundColor, value: charColor, range: NSRange(location: index, length: 1))
}