Introduce color provider to encapsulate check for iOS 13 availability
This commit is contained in:
parent
e0c32003e3
commit
51c9510f3d
12 changed files with 80 additions and 41 deletions
|
|
@ -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.red
|
||||
charColor = Colors.systemRed
|
||||
} else if !NSCharacterSet.letters.contains(element) {
|
||||
charColor = Globals.blue
|
||||
charColor = Colors.systemBlue
|
||||
} else {
|
||||
charColor = Globals.black
|
||||
charColor = Colors.label
|
||||
}
|
||||
attributedPassword.addAttribute(NSAttributedString.Key.foregroundColor, value: charColor, range: NSRange(location: index, length: 1))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue