From c794add84d5679401a9a4cd116fabb538f8baab9 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 30 Jul 2024 13:44:03 -0500 Subject: [PATCH] removed duplicate struct for view masking protocol Signed-off-by: Matt Bruce --- .../TextFields/TextViewEntryField.swift | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextViewEntryField.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextViewEntryField.swift index a76e9451..1cacbeae 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextViewEntryField.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextViewEntryField.swift @@ -148,25 +148,28 @@ open class TextViewEntryField: VDS.TextArea, VDSMoleculeViewProtocol, ObservingT } switch viewModel.type { - case .secure, .password: + case .secure: textView.isSecureTextEntry = true textView.shouldMaskWhileRecording = true - + case .numberSecure: textView.isSecureTextEntry = true - textView.keyboardType = .numberPad textView.shouldMaskWhileRecording = true - - case .number: textView.keyboardType = .numberPad case .email: textView.keyboardType = .emailAddress -//uncomment out once inputField branch is merged and update this logic -// case .securityCode, .creditCard: -// textView.shouldMaskWhileRecording = true - - default: break + + case .securityCode, .creditCard, .password: + textView.shouldMaskWhileRecording = true + + default: + break; + } + + // Override the preset keyboard set in type. + if let keyboardType = viewModel.assignKeyboardType() { + textView.keyboardType = keyboardType } /// append any internal rules: @@ -229,10 +232,6 @@ open class TextViewEntryField: VDS.TextArea, VDSMoleculeViewProtocol, ObservingT open func updateView(_ size: CGFloat) {} } -internal struct ViewMasking { - static var shouldMaskWhileRecording: UInt8 = 0 -} - extension VDS.TextView: ViewMaskingProtocol { public var shouldMaskWhileRecording: Bool { get {