diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 9998b873..1530665e 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -130,6 +130,7 @@ 1D6D258826899B0C00DEBB08 /* ImageButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D6D258626899B0B00DEBB08 /* ImageButtonModel.swift */; }; 1D6D258926899B0C00DEBB08 /* ImageButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D6D258726899B0B00DEBB08 /* ImageButton.swift */; }; 27559EFC27D691D3000836C1 /* ViewMaskingProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27559EFB27D691D3000836C1 /* ViewMaskingProtocol.swift */; }; + 27577DCD286CA959001EC47E /* MoleculeMaskingProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27577DCC286CA959001EC47E /* MoleculeMaskingProtocol.swift */; }; 279B1569242BBC2F00921D6C /* ActionModelAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 279B1568242BBC2F00921D6C /* ActionModelAdapter.swift */; }; 27F6B08826051831008529AA /* MoleculeTreeTraversalProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27F6B08726051831008529AA /* MoleculeTreeTraversalProtocol.swift */; }; 27F6B08C26052AFF008529AA /* ParentMoleculeModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27F6B08B26052AFF008529AA /* ParentMoleculeModelProtocol.swift */; }; @@ -722,6 +723,7 @@ 1D6D258626899B0B00DEBB08 /* ImageButtonModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImageButtonModel.swift; path = MVMCoreUI/Atomic/Atoms/Buttons/ImageButtonModel.swift; sourceTree = SOURCE_ROOT; }; 1D6D258726899B0B00DEBB08 /* ImageButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImageButton.swift; path = MVMCoreUI/Atomic/Atoms/Buttons/ImageButton.swift; sourceTree = SOURCE_ROOT; }; 27559EFB27D691D3000836C1 /* ViewMaskingProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewMaskingProtocol.swift; sourceTree = ""; }; + 27577DCC286CA959001EC47E /* MoleculeMaskingProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeMaskingProtocol.swift; sourceTree = ""; }; 279B1568242BBC2F00921D6C /* ActionModelAdapter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionModelAdapter.swift; sourceTree = ""; }; 27F6B08726051831008529AA /* MoleculeTreeTraversalProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeTreeTraversalProtocol.swift; sourceTree = ""; }; 27F6B08B26052AFF008529AA /* ParentMoleculeModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParentMoleculeModelProtocol.swift; sourceTree = ""; }; @@ -1223,6 +1225,7 @@ D2509ED02472ED9B001BFB9D /* NavigationItemModelProtocol.swift */, D28BA74C248589C800B75CB8 /* TabPageModelProtocol.swift */, 27F6B08B26052AFF008529AA /* ParentMoleculeModelProtocol.swift */, + 27577DCC286CA959001EC47E /* MoleculeMaskingProtocol.swift */, ); path = ModelProtocols; sourceTree = ""; @@ -3072,6 +3075,7 @@ D29DF2AA21E7B2F9003B2FB9 /* MVMCoreUIConstants.m in Sources */, EA41F4AC2787927100F5B377 /* DynamicRuleFormFieldEffectModel.swift in Sources */, 011D95892404249B000E3791 /* FormHolderModelProtocol.swift in Sources */, + 27577DCD286CA959001EC47E /* MoleculeMaskingProtocol.swift in Sources */, BB54C5202434D92F0038326C /* ListRightVariableButtonAllTextAndLinks.swift in Sources */, 948DB67E2326DCD90011F916 /* MultiProgress.swift in Sources */, 013F801923FB4A8E00AD8013 /* UIContentMode+Extension.swift in Sources */, diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/EntryFieldModel.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/EntryFieldModel.swift index a2d4ff96..c3134e19 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/EntryFieldModel.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/EntryFieldModel.swift @@ -42,7 +42,7 @@ import Foundation public var wasInitiallySelected: Bool = false public var title: String? public var feedback: String? - public var shouldMaskRecordedView: Bool = true + public var shouldMaskRecordedView: Bool? = true //used to drive the EntryFieldView UI public var titleStateLabel: FormLabelModel diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift index 1f2b8e3a..07260ac1 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift @@ -337,7 +337,7 @@ import UIKit text = model.text placeholder = model.placeholder - textField.shouldMaskWhileRecording = model.shouldMaskRecordedView + textField.shouldMaskWhileRecording = model.shouldMaskRecordedView ?? true switch model.type { case .password, .secure: diff --git a/MVMCoreUI/Atomic/Atoms/Views/ImageViewModel.swift b/MVMCoreUI/Atomic/Atoms/Views/ImageViewModel.swift index 9b019207..03c18491 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/ImageViewModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/ImageViewModel.swift @@ -26,7 +26,7 @@ public var localBundle: Bundle? public var cornerRadius: CGFloat? public var clipsImage: Bool? - public var shouldMaskRecordedView: Bool = false + public var shouldMaskRecordedView: Bool? = false //-------------------------------------------------- // MARK: - Initializer diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index feaaa878..2ad66ede 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -247,7 +247,7 @@ public typealias ActionBlock = () -> () text = nil attributedText = nil originalAttributedString = nil - shouldMaskWhileRecording = model.shouldMaskRecordedView + shouldMaskWhileRecording = model.shouldMaskRecordedView ?? false guard let labelModel = model as? LabelModel else { return } diff --git a/MVMCoreUI/Atomic/Protocols/ModelProtocols/MoleculeMaskingProtocol.swift b/MVMCoreUI/Atomic/Protocols/ModelProtocols/MoleculeMaskingProtocol.swift new file mode 100644 index 00000000..b9e9997e --- /dev/null +++ b/MVMCoreUI/Atomic/Protocols/ModelProtocols/MoleculeMaskingProtocol.swift @@ -0,0 +1,17 @@ +// +// MaskedMoleculeProtocol.swift +// MVMCoreUI +// +// Created by Kyle on 6/29/22. +// Copyright © 2022 Verizon Wireless. All rights reserved. +// + +import Foundation + +public protocol MoleculeMaskingProtocol { + var shouldMaskRecordedView: Bool? { get } +} + +public extension MoleculeMaskingProtocol { + var shouldMaskRecordedView: Bool? { return false } +} diff --git a/MVMCoreUI/Atomic/Protocols/ModelProtocols/MoleculeModelProtocol.swift b/MVMCoreUI/Atomic/Protocols/ModelProtocols/MoleculeModelProtocol.swift index 240136c2..1f1fdc1e 100644 --- a/MVMCoreUI/Atomic/Protocols/ModelProtocols/MoleculeModelProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/ModelProtocols/MoleculeModelProtocol.swift @@ -5,10 +5,9 @@ public enum MolecularError: Swift.Error { } -public protocol MoleculeModelProtocol: ModelProtocol, AccessibilityModelProtocol, MoleculeTreeTraversalProtocol { +public protocol MoleculeModelProtocol: ModelProtocol, AccessibilityModelProtocol, MoleculeTreeTraversalProtocol, MoleculeMaskingProtocol { var moleculeName: String { get } var backgroundColor: Color? { get set } - var shouldMaskRecordedView: Bool { get } } public extension MoleculeModelProtocol { @@ -18,8 +17,6 @@ public extension MoleculeModelProtocol { static var categoryName: String { "\(MoleculeModelProtocol.self)" } static var categoryCodingKey: String { "moleculeName" } - - var shouldMaskRecordedView: Bool { return false } } diff --git a/MVMCoreUI/Atomic/Protocols/ModelProtocols/PageModelProtocol.swift b/MVMCoreUI/Atomic/Protocols/ModelProtocols/PageModelProtocol.swift index 5796eb0a..122adcee 100644 --- a/MVMCoreUI/Atomic/Protocols/ModelProtocols/PageModelProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/ModelProtocols/PageModelProtocol.swift @@ -13,5 +13,5 @@ public protocol PageModelProtocol { var screenHeading: String? { get set } var backgroundColor: Color? { get set } var navigationBar: (NavigationItemModelProtocol & MoleculeModelProtocol)? { get set } - var shouldMaskScreenWhileRecording: Bool { get } + var shouldMaskScreenWhileRecording: Bool? { get } } diff --git a/MVMCoreUI/Atomic/Protocols/ViewMaskingProtocol.swift b/MVMCoreUI/Atomic/Protocols/ViewMaskingProtocol.swift index db3073c8..e8004790 100644 --- a/MVMCoreUI/Atomic/Protocols/ViewMaskingProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/ViewMaskingProtocol.swift @@ -13,9 +13,3 @@ public protocol ViewMaskingProtocol: UIView { var shouldMaskWhileRecording: Bool { get } } - -public protocol ViewMaskingContainerProtocol { - - var maskedViewsWhileRecording: [UIView] { get } - -} diff --git a/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift b/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift index 1a4d6bab..b60ca4bc 100644 --- a/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/BaseTemplateModel.swift @@ -32,7 +32,7 @@ import Foundation public var tabBarIndex: Int? // By default we mask until the server unlocks the page. - public var shouldMaskScreenWhileRecording: Bool = true + public var shouldMaskScreenWhileRecording: Bool? //-------------------------------------------------- // MARK: - Initializer @@ -81,7 +81,7 @@ import Foundation self.tabBarHidden = tabBarHidden } tabBarIndex = try typeContainer.decodeIfPresent(Int.self, forKey: .tabBarIndex) - shouldMaskScreenWhileRecording = try typeContainer.decodeIfPresent(Bool.self, forKey: .shouldMaskScreenWhileRecording) ?? shouldMaskScreenWhileRecording + shouldMaskScreenWhileRecording = try typeContainer.decodeIfPresent(Bool.self, forKey: .shouldMaskScreenWhileRecording) } open func encode(to encoder: Encoder) throws { diff --git a/MVMCoreUI/BaseClasses/TextField.swift b/MVMCoreUI/BaseClasses/TextField.swift index 5b0dc369..306b363f 100644 --- a/MVMCoreUI/BaseClasses/TextField.swift +++ b/MVMCoreUI/BaseClasses/TextField.swift @@ -101,7 +101,7 @@ extension TextField: MoleculeViewProtocol { self.accessibilityIdentifier = accessibilityIdentifier } - shouldMaskWhileRecording = model.shouldMaskRecordedView + shouldMaskWhileRecording = model.shouldMaskRecordedView ?? true } open func reset() {