Skip to content

Commit 913160e

Browse files
authored
Merge pull request #10 from ahmetsina/development
Read-only config properties changed to read-write
2 parents 8a1a981 + fd117ee commit 913160e

2 files changed

Lines changed: 13 additions & 27 deletions

File tree

ALFormInput.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'ALFormInput'
11-
s.version = '0.2.1'
11+
s.version = '0.2.2'
1212
s.summary = 'Commonly used form inputs in our projects'
1313

1414
s.homepage = 'https://github.com/applogistdev/ALFormInput'

ALFormInput/Classes/ALValidatableConfig.swift

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@ public class ALTextFieldConfig: NSObject {
2222

2323
public var textColor: UIColor = .systemGray
2424

25-
public var titleColor: UIColor {
26-
if #available(iOS 13.0, *) {
27-
return .label
28-
} else {
29-
return UIColor.lightGray
30-
}
31-
}
25+
public var titleColor: UIColor = .darkGray
3226

3327
public var placeholderColor: UIColor = .lightGray
3428

@@ -42,37 +36,29 @@ public class ALTextFieldConfig: NSObject {
4236

4337
public var errorColor: UIColor = .systemRed
4438

45-
public var textErrorColor: UIColor? {
46-
errorColor
47-
}
39+
public var textErrorColor: UIColor? = .systemRed
4840

49-
public var lineErrorColor: UIColor? {
50-
errorColor
51-
}
41+
public var lineErrorColor: UIColor? = .systemRed
5242

53-
public var titleErrorColor: UIColor? {
54-
errorColor
55-
}
43+
public var titleErrorColor: UIColor? = .systemRed
5644

5745
// MARK: - TextField UIControl Event
5846

5947
public var validateEventType: UIControl.Event = .editingDidEnd
6048

6149
public var iconType: IconType = .image
6250

63-
public var iconColor: UIColor {
64-
titleColor
65-
}
51+
public var iconColor: UIColor = .darkGray
6652

67-
public var selectedIconColor: UIColor {
68-
selectedTitleColor
69-
}
53+
public var selectedIconColor: UIColor = .systemBlue
7054

71-
public var iconWidth: CGFloat {
72-
isIconVisible ? 20 : -4
73-
}
55+
public var iconWidth: CGFloat = -4
7456

75-
public var isIconVisible: Bool = false
57+
public var isIconVisible: Bool = false {
58+
didSet {
59+
iconWidth = isIconVisible ? 20 : -4
60+
}
61+
}
7662

7763
public override init () {}
7864
}

0 commit comments

Comments
 (0)