removed unneeded method. mild changes.
This commit is contained in:
parent
499b938d56
commit
3654b05773
@ -269,7 +269,7 @@ import UIKit
|
||||
return enteredValue.count > 0 && enteredValue.count == self.digitBoxes.count
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@objc public func selectPreviousDigitField(_ currentTextField: UITextField?, clear: Bool) {
|
||||
|
||||
var selectPreviousField = false
|
||||
@ -339,11 +339,6 @@ import UIKit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc open class func getEnabledDigitFields(_ textFieldToDetermine: [DigitBox]) -> [TextField]? {
|
||||
|
||||
return textFieldToDetermine.filter { $0.isEnabled }.compactMap { $0.digitField }
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - TextField Delegate
|
||||
@ -374,8 +369,8 @@ extension DigitEntryField {
|
||||
|
||||
// One character, switch old value with new, select next textfield
|
||||
textField.text = string
|
||||
selectNextDigitField(textField, clear: false)
|
||||
valueChanged()
|
||||
selectNextDigitField(textField, clear: false)
|
||||
return false
|
||||
|
||||
} else if replacementLength == 0 && oldLength == 1 {
|
||||
@ -398,11 +393,6 @@ extension DigitEntryField {
|
||||
|
||||
@objc public func textFieldDidBeginEditing(_ textField: UITextField) {
|
||||
|
||||
if !switchFieldsAutomatically {
|
||||
textField.text = ""
|
||||
valueChanged()
|
||||
}
|
||||
|
||||
digitBoxes.forEach {
|
||||
if $0.digitField === textField {
|
||||
selectedDigitBox = $0
|
||||
@ -411,18 +401,19 @@ extension DigitEntryField {
|
||||
}
|
||||
}
|
||||
|
||||
if !switchFieldsAutomatically {
|
||||
textField.text = ""
|
||||
valueChanged()
|
||||
}
|
||||
|
||||
proprietorTextDelegate?.textFieldDidBeginEditing?(textField)
|
||||
}
|
||||
|
||||
@objc public func textFieldDidEndEditing(_ textField: UITextField) {
|
||||
|
||||
digitBoxes.forEach {
|
||||
if $0.digitField === textField {
|
||||
selectedDigitBox = nil
|
||||
$0.isSelected = false
|
||||
return
|
||||
}
|
||||
}
|
||||
// There should only be one digitBox to deselect.
|
||||
selectedDigitBox?.isSelected = false
|
||||
selectedDigitBox = nil
|
||||
|
||||
proprietorTextDelegate?.textFieldDidEndEditing?(textField)
|
||||
}
|
||||
|
||||
@ -224,6 +224,9 @@ import UIKit
|
||||
observingTextFieldDelegate?.isInvalid?(textfield: self)
|
||||
|
||||
} else if isValid {
|
||||
if showError == true {
|
||||
showError = false
|
||||
}
|
||||
isSelected = true
|
||||
observingTextFieldDelegate?.isValid?(textfield: self)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user