@@ -63,7 +63,7 @@ open class ValidationTextField: UITextField {
6363 createTitleLabel ( )
6464 }
6565 }
66- @IBInspectable
66+ @IBInspectable
6767 open var titleColor : UIColor = UIColor ( red: 0.49 , green: 0.49 , blue: 0.49 , alpha: 1.0 ) {
6868 didSet{
6969 update ( )
@@ -136,6 +136,8 @@ open class ValidationTextField: UITextField {
136136
137137 open var errorImage : UIImage ?
138138
139+ open lazy var statusImageView = UIImageView ( )
140+
139141 private lazy var titleLabel = UILabel ( )
140142
141143 private lazy var errorLabel = UILabel ( )
@@ -144,8 +146,6 @@ open class ValidationTextField: UITextField {
144146
145147 private lazy var containerView = UIStackView ( )
146148
147- private lazy var statusImageView = UIImageView ( )
148-
149149 private var validateStatus : ValidateType = . ready {
150150 didSet {
151151 switch validateStatus {
@@ -252,7 +252,7 @@ open class ValidationTextField: UITextField {
252252 lineView. isUserInteractionEnabled = false
253253 lineView. backgroundColor = titleColor
254254 configureDefaultLineHeight ( )
255-
255+
256256 lineView. autoresizingMask = [ . flexibleWidth, . flexibleTopMargin]
257257 addSubview ( lineView)
258258 }
@@ -377,13 +377,13 @@ open class ValidationTextField: UITextField {
377377 options: animationOptions,
378378 animations: { ( ) -> Void in
379379 updateBlock ( )
380- } ,
380+ } ,
381381 completion: nil )
382382 }
383383 }
384384
385385 private func update( ) {
386- if !isValid && isEditing && text != " " {
386+ if !isValid && text != " " {
387387 errorLabel. text = errorMessage
388388 errorLabel. textColor = errorColor
389389 errorLabel. font = errorFont
0 commit comments