forked from 3lvis/FormTextField
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CustomStyle.swift
executable file
·40 lines (32 loc) · 1.92 KB
/
CustomStyle.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import Foundation
import FormTextField
struct CustomStyle {
static func apply() {
let enabledBackgroundColor = UIColor.white
let enabledBorderColor = UIColor(hex: "DFDFDF")
let enabledTextColor = UIColor(hex: "455C73")
let activeBorderColor = UIColor(hex: "70D7FF")
FormTextField.appearance().borderWidth = 2
FormTextField.appearance().cornerRadius = 10
FormTextField.appearance().clearButtonColor = activeBorderColor
FormTextField.appearance().font = UIFont(name: "AvenirNext-Regular", size: 15)!
FormTextField.appearance().enabledBackgroundColor = enabledBackgroundColor
FormTextField.appearance().enabledBorderColor = enabledBorderColor
FormTextField.appearance().enabledTextColor = enabledTextColor
FormTextField.appearance().validBackgroundColor = enabledBackgroundColor
FormTextField.appearance().validBorderColor = enabledBorderColor
FormTextField.appearance().validTextColor = enabledTextColor
FormTextField.appearance().activeBackgroundColor = enabledBackgroundColor
FormTextField.appearance().activeBorderColor = activeBorderColor
FormTextField.appearance().activeTextColor = enabledTextColor
FormTextField.appearance().inactiveBackgroundColor = enabledBackgroundColor
FormTextField.appearance().inactiveBorderColor = enabledBorderColor
FormTextField.appearance().inactiveTextColor = enabledTextColor
FormTextField.appearance().disabledBackgroundColor = UIColor(hex: "DFDFDF")
FormTextField.appearance().disabledBorderColor = UIColor(hex: "DFDFDF")
FormTextField.appearance().disabledTextColor = UIColor.white
FormTextField.appearance().invalidBackgroundColor = UIColor(hex: "FFC9C8")
FormTextField.appearance().invalidBorderColor = UIColor(hex: "FF4B47")
FormTextField.appearance().invalidTextColor = UIColor(hex: "FF4B47")
}
}