-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathEGTextFieldConfig.swift
59 lines (55 loc) · 2.03 KB
/
EGTextFieldConfig.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// EGTextFieldConfig.swift
// CustomEdittext
//
// Created by Esat Gözcü on 2023/04/03.
//
import SwiftUI
@available(iOS 13.0, *)
public class EGTextFieldConfig{
public static var shared = EGTextFieldConfig()
private init(){}
//Text Color
public var defaultTextColor : Color = .black
public var darkModeTextColor : Color = .white
//Title Color
public var defaultTitleColor : Color = .black
public var darkModeTitleColor : Color = .white
//PlaceHolder Text Color
public var defaultPlaceHolderTextColor : Color = .gray.opacity(0.8)
public var darkModePlaceHolderTextColor : Color = .white.opacity(0.3)
//Disable Color
public var defaultDisableColor : Color = .gray.opacity(0.5)
public var darkModeDisableColor : Color = .gray.opacity(0.3)
//Background Color
public var defaultBackgroundColor : Color = .white
public var darkModeBackgroundColor : Color = .black
//Error Text Color
public var defaultErrorTextColor : Color = .red
public var darkModeErrorTextColor : Color = .red
//Border Color
public var defaultBorderColor : Color = .gray
public var darkModeBorderColor : Color = .white.opacity(0.7)
//Trailing Image Color
public var defaultTrailingImageForegroundColor : Color = .black
public var darkModeTrailingImageForegroundColor : Color = .white
//Focused Border Color
public var focusedBorderColorEnable: Bool = false
public var defaultFocusedBorderColor : Color = .black
public var darkModeFocusedBorderColor : Color = .white
//Font
public var textFont : Font = .system(size: 17)
public var titleFont : Font = .callout
public var errorFont : Font = .footnote
public var placeHolderFont : Font = .subheadline
//Default
public var borderWidth : CGFloat = 1.0
public var cornerRadius : CGFloat = 5.0
public var borderType: BorderType = .square
public var disableAutoCorrection: Bool = false
public var textFieldHeight : CGFloat = 45
}
public enum BorderType {
case square
case line
}