feedback independence.
This commit is contained in:
parent
bcddc0b311
commit
1fec5464af
@ -22,7 +22,7 @@ import UIKit
|
||||
private var switchFieldsAutomatically = false
|
||||
|
||||
public var digitBoxes: [DigitBox] = []
|
||||
var selectedDigitBox: DigitBox?
|
||||
private var selectedDigitBox: DigitBox?
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Computed Properties
|
||||
|
||||
@ -77,7 +77,7 @@ import UIKit
|
||||
guard let self = self else { return }
|
||||
|
||||
self.entryFieldContainer.showError = error
|
||||
self.feedback = error ? self.errorMessage : nil
|
||||
self.feedback = error ? self.errorMessage : self.standardMessage
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -243,6 +243,11 @@ import UIKit
|
||||
feedbackLabel.reset()
|
||||
entryFieldContainer.reset()
|
||||
}
|
||||
|
||||
open func feedbackStandardMessage(_ message: String? = nil) {
|
||||
|
||||
feedback = message ?? standardMessage
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - MVMCoreUIMoleculeViewProtocol
|
||||
@ -268,6 +273,11 @@ extension EntryField {
|
||||
errorMessage = errMessage
|
||||
}
|
||||
|
||||
if let feedback = dictionary["feedback"] as? String {
|
||||
self.standardMessage = feedback
|
||||
feedbackStandardMessage()
|
||||
}
|
||||
|
||||
if let isLocked = dictionary["isLocked"] as? Bool {
|
||||
self.isLocked = isLocked
|
||||
}
|
||||
|
||||
@ -224,13 +224,13 @@ import UIKit
|
||||
|
||||
isValid = validationBlock?(text) ?? true
|
||||
|
||||
if !isValid {
|
||||
showError = true
|
||||
observingTextFieldDelegate?.isInvalid?(textfield: self)
|
||||
|
||||
} else {
|
||||
if isValid {
|
||||
showError = false
|
||||
observingTextFieldDelegate?.isValid?(textfield: self)
|
||||
|
||||
} else {
|
||||
showError = true
|
||||
observingTextFieldDelegate?.isInvalid?(textfield: self)
|
||||
}
|
||||
|
||||
return isValid
|
||||
|
||||
Loading…
Reference in New Issue
Block a user