revised how fields clear themselves

This commit is contained in:
Kevin G Christiano 2020-04-28 14:14:26 -04:00
parent b072fbb558
commit e5ab254579

View File

@ -35,6 +35,7 @@ import UIKit
digitBoxes.append(newDigitBox) digitBoxes.append(newDigitBox)
} }
self.digitBoxes.forEach { $0.removeFromSuperview() }
self.digitBoxes = digitBoxes self.digitBoxes = digitBoxes
guard let space = MFSizeObject(standardSize: 5, smalliPhoneSize: 3)?.getValueBasedOnScreenSize() else { return } guard let space = MFSizeObject(standardSize: 5, smalliPhoneSize: 3)?.getValueBasedOnScreenSize() else { return }
@ -228,7 +229,7 @@ import UIKit
//-------------------------------------------------- //--------------------------------------------------
@objc open override func updateView(_ size: CGFloat) { @objc open override func updateView(_ size: CGFloat) {
entryFieldContainer.disableAllBorders = true entryFieldContainer.disableAllBorders = true
if !self.digitBoxes.isEmpty { if !self.digitBoxes.isEmpty {
@ -245,10 +246,7 @@ import UIKit
switchFieldsAutomatically = false switchFieldsAutomatically = false
selectedDigitBox = nil selectedDigitBox = nil
text = "" text = ""
digitBoxes.forEach { digitBoxes.forEach { $0.digitField.text = "" }
$0.removeFromSuperview()
}
digitBoxes = []
} }
//-------------------------------------------------- //--------------------------------------------------
@ -358,7 +356,7 @@ import UIKit
$0.digitField.inputAccessoryView = UIToolbar.getToolbarWithDoneButton(delegate: observingDelegate, $0.digitField.inputAccessoryView = UIToolbar.getToolbarWithDoneButton(delegate: observingDelegate,
action: #selector(observingDelegate.dismissFieldInput)) action: #selector(observingDelegate.dismissFieldInput))
} }
super.set(with: model, delegateObject, additionalData) super.set(with: model, delegateObject, additionalData)
} }