feedback independence.

This commit is contained in:
Kevin G Christiano 2019-12-16 10:02:41 -05:00
parent bcddc0b311
commit 1fec5464af
3 changed files with 17 additions and 7 deletions

View File

@ -22,7 +22,7 @@ import UIKit
private var switchFieldsAutomatically = false
public var digitBoxes: [DigitBox] = []
var selectedDigitBox: DigitBox?
private var selectedDigitBox: DigitBox?
//--------------------------------------------------
// MARK: - Computed Properties

View File

@ -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
}

View File

@ -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