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