From 78fbadb1e1c94d41ef7bf30057626d5f52a5f84d Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 4 Mar 2020 16:46:21 +0530 Subject: [PATCH 01/80] 19198 - Headers - H1 - Button initial commit --- MVMCoreUI.xcodeproj/project.pbxproj | 8 +++ .../DesignedComponents/HeadersH1Button.swift | 51 +++++++++++++++++ .../HeadersH1ButtonModel.swift | 56 +++++++++++++++++++ .../OtherHandlers/MoleculeObjectMapping.swift | 2 + 4 files changed, 117 insertions(+) create mode 100644 MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift create mode 100644 MVMCoreUI/Molecules/DesignedComponents/HeadersH1ButtonModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 339735f3..6ac7694e 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -147,6 +147,8 @@ 94F217B723E0BF6100A47C06 /* PrimaryButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */; }; 94FB966223D797DA003D482B /* MFTextButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 94FB966023D797DA003D482B /* MFTextButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; + AA119DE8240FB41C005F98FD /* HeadersH1Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA119DE7240FB41C005F98FD /* HeadersH1Button.swift */; }; + AA119DEA240FB430005F98FD /* HeadersH1ButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; C003506123AA94CD00B6AC29 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003506023AA94CD00B6AC29 /* Button.swift */; }; @@ -492,6 +494,8 @@ 94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PrimaryButtonView.m; sourceTree = ""; }; 94FB966023D797DA003D482B /* MFTextButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFTextButton.h; sourceTree = ""; }; 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; + AA119DE7240FB41C005F98FD /* HeadersH1Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Button.swift; sourceTree = ""; }; + AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1ButtonModel.swift; sourceTree = ""; }; AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = ""; }; AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = ""; }; C003506023AA94CD00B6AC29 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; @@ -1041,6 +1045,8 @@ children = ( D22B38EC23F4E10700490EF6 /* SectionDividers */, D22B38EA23F4E08B00490EF6 /* List */, + AA119DE7240FB41C005F98FD /* HeadersH1Button.swift */, + AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */, ); path = DesignedComponents; sourceTree = ""; @@ -1819,6 +1825,7 @@ 0A7EF86723D8B0AE00B2AAD1 /* DateDropdownEntryFieldModel.swift in Sources */, 94FB966323D797DA003D482B /* MFTextButton.m in Sources */, D260105323CEA61600764D80 /* ToggleModel.swift in Sources */, + AA119DEA240FB430005F98FD /* HeadersH1ButtonModel.swift in Sources */, 014AA72523C501E2006F3E93 /* ContainerModel.swift in Sources */, 0A7EF86523D8AFFF00B2AAD1 /* ItemDropdownEntryFieldModel.swift in Sources */, D29DF2EF21ECEAE1003B2FB9 /* MFFonts.m in Sources */, @@ -1912,6 +1919,7 @@ 0AE98BB723FF18E9004C5109 /* ArrowModel.swift in Sources */, D28A837D23CCA86A00DFE4FC /* TabsListItemModel.swift in Sources */, 012A88C6238DA34000FE3DA1 /* ModuleMoleculeModel.swift in Sources */, + AA119DE8240FB41C005F98FD /* HeadersH1Button.swift in Sources */, 94C2D9A123872BCC0006CF46 /* LabelAttributeUnderlineModel.swift in Sources */, D20A9A5E2243D3E300ADE781 /* TwoButtonView.swift in Sources */, D2B1E3E522F37D6A0065F95C /* ImageHeadlineBody.swift in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift new file mode 100644 index 00000000..6e720fd4 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift @@ -0,0 +1,51 @@ +// +// HeadersH1Button.swift +// MVMCoreUI +// +// Created by Lekshmi S on 04/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class HeadersH1Button: View { + //-------------------------------------------------- + // MARK: - Outlets + //-------------------------------------------------- + let headlineBody = HeadlineBody(frame: .zero) + let button = PrimaryButton.button() + let stack = UIStackView() + + //------------------------------------------------------- + // MARK: - View Lifecycle + //------------------------------------------------------- + open override func setupView() { + super.setupView() + stack.translatesAutoresizingMaskIntoConstraints = false + stack.addArrangedSubview(headlineBody) + stack.setCustomSpacing(72.0, after: headlineBody) + stack.addArrangedSubview(button) + stack.axis = .vertical + stack.alignment = .leading + } + + //---------------------------------------------------- + // MARK: - Molecule + //------------------------------------------------------ + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { + super.set(with: model, delegateObject, additionalData) + guard let model = model as? HeadersH1ButtonModel else { return } + headlineBody.set(with: model.headlineBody, delegateObject, additionalData) + button.set(with: model.button, delegateObject, additionalData) + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 121 + } + + open override func reset() { + super.reset() + headlineBody.reset() + button.reset() + } +} diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1ButtonModel.swift b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1ButtonModel.swift new file mode 100644 index 00000000..48e639a4 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1ButtonModel.swift @@ -0,0 +1,56 @@ +// +// HeadersH1ButtonModel.swift +// MVMCoreUI +// +// Created by Lekshmi S on 04/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class HeadersH1ButtonModel: MoleculeModelProtocol { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + + public static var identifier: String = "headerH1Btn" + public var backgroundColor: Color? + public var headlineBody: HeadlineBodyModel + public var button: ButtonModel + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public init(headlineBody: HeadlineBodyModel, button: ButtonModel) { + self.headlineBody = headlineBody + self.button = button + } + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + private enum CodingKeys: String, CodingKey { + case moleculeName + case backgroundColor + case headlineBody + case button + } + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) + headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody) + button = try typeContainer.decode(ButtonModel.self, forKey: .button) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + try container.encode(headlineBody, forKey: .headlineBody) + try container.encode(button, forKey: .button) + } +} diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index 34da2080..cb11e2f4 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -103,6 +103,8 @@ import Foundation MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListLeftVariableRadioButtonAndPaymentMethod.self, viewModelClass: ListLeftVariableRadioButtonAndPaymentMethodModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListRVWheel.self, viewModelClass: ListRVWheelModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListOneColumnFullWidthTextAllTextAndLinks.self, viewModelClass: ListOneColumnFullWidthTextAllTextAndLinksModel.self) + + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH1Button.self, viewModelClass: HeadersH1ButtonModel.self) // Designed Section Dividers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) From f2b5c53f3a3d7d06dfbef23cfbc9fa8ff3f88dbd Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Thu, 5 Mar 2020 10:25:22 +0530 Subject: [PATCH 02/80] Code refactor. --- .../DesignedComponents/HeadersH1Button.swift | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift index 6e720fd4..7e600f7b 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift @@ -14,19 +14,23 @@ import Foundation //-------------------------------------------------- let headlineBody = HeadlineBody(frame: .zero) let button = PrimaryButton.button() - let stack = UIStackView() + var stack = Stack(frame: .zero) + var spacingBetwenHeadlineBodyAndButton: CGFloat = 72.0 //------------------------------------------------------- // MARK: - View Lifecycle //------------------------------------------------------- open override func setupView() { super.setupView() - stack.translatesAutoresizingMaskIntoConstraints = false - stack.addArrangedSubview(headlineBody) - stack.setCustomSpacing(72.0, after: headlineBody) - stack.addArrangedSubview(button) - stack.axis = .vertical - stack.alignment = .leading + stack = Stack.createStack(with: [(view: headlineBody, model: StackItemModel(horizontalAlignment: .leading)), + (view: button, model: StackItemModel(spacing: spacingBetwenHeadlineBodyAndButton, horizontalAlignment: .leading))], axis: .vertical) + addSubview(stack) + NSLayoutConstraint.constraintPinSubview(toSuperview: stack) + } + + open override func updateView(_ size: CGFloat) { + super.updateView(size) + stack.updateView(size) } //---------------------------------------------------- @@ -37,6 +41,7 @@ import Foundation guard let model = model as? HeadersH1ButtonModel else { return } headlineBody.set(with: model.headlineBody, delegateObject, additionalData) button.set(with: model.button, delegateObject, additionalData) + stack.restack() } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { From 105c5b5f785848f34842d1703c9fdc51ba0bd24a Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Thu, 5 Mar 2020 12:31:26 +0530 Subject: [PATCH 03/80] Code refactor changes --- MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift index 7e600f7b..0600cf1e 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift @@ -50,7 +50,7 @@ import Foundation open override func reset() { super.reset() - headlineBody.reset() + headlineBody.styleLandingPageHeader() button.reset() } } From 12d8520e424ce05a68360684fcfea755d5870914 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Mon, 9 Mar 2020 13:24:48 +0530 Subject: [PATCH 04/80] 19210(Headers - H1 - Bill) initial commit. Created molecule and model class --- MVMCoreUI.xcodeproj/project.pbxproj | 8 ++ .../DesignedComponents/HeadersH1Bill.swift | 76 +++++++++++++++++++ .../HeadersH1BillModel.swift | 76 +++++++++++++++++++ .../OtherHandlers/MoleculeObjectMapping.swift | 1 + 4 files changed, 161 insertions(+) create mode 100644 MVMCoreUI/Molecules/DesignedComponents/HeadersH1Bill.swift create mode 100644 MVMCoreUI/Molecules/DesignedComponents/HeadersH1BillModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 8de69762..ad7231bb 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -154,6 +154,8 @@ 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; + AA3CA8D0241627CE008BF379 /* HeadersH1Bill.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */; }; + AA3CA8D2241627DB008BF379 /* HeadersH1BillModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */; }; C003506123AA94CD00B6AC29 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003506023AA94CD00B6AC29 /* Button.swift */; }; C07065C42395677300FBF997 /* Link.swift in Sources */ = {isa = PBXBuildFile; fileRef = C07065C32395677300FBF997 /* Link.swift */; }; C695A67F23C9830600BFB94E /* UnOrderedListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */; }; @@ -505,6 +507,8 @@ 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = ""; }; AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = ""; }; + AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Bill.swift; sourceTree = ""; }; + AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1BillModel.swift; sourceTree = ""; }; C003506023AA94CD00B6AC29 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; C07065C32395677300FBF997 /* Link.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Link.swift; sourceTree = ""; }; C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnOrderedListModel.swift; sourceTree = ""; }; @@ -1054,6 +1058,8 @@ 525239C32407FFCC00454969 /* LockUps */, D22B38EC23F4E10700490EF6 /* SectionDividers */, D22B38EA23F4E08B00490EF6 /* List */, + AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */, + AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */, ); path = DesignedComponents; sourceTree = ""; @@ -1788,6 +1794,7 @@ D29DF27621E79E81003B2FB9 /* MVMCoreUILoggingHandler.m in Sources */, C695A69623C990BC00BFB94E /* DoughnutChart.swift in Sources */, 014AA72D23C5059B006F3E93 /* StackPageTemplateModel.swift in Sources */, + AA3CA8D0241627CE008BF379 /* HeadersH1Bill.swift in Sources */, D260106123D0C02A00764D80 /* StackItemModelProtocol.swift in Sources */, 0AE98BAF23FEF956004C5109 /* ExternalLink.swift in Sources */, 012A88C4238D86E600FE3DA1 /* CarouselItemModelProtocol.swift in Sources */, @@ -1847,6 +1854,7 @@ D22479942316AE5E003FCCF9 /* NSLayoutConstraintExtension.swift in Sources */, D2B18B94236214AD00A9AEDC /* NavigationController.swift in Sources */, D29E28DA23D21AFA00ACEA85 /* StringAndMoleculeModel.swift in Sources */, + AA3CA8D2241627DB008BF379 /* HeadersH1BillModel.swift in Sources */, D282AACB2243C61700C46919 /* ButtonView.swift in Sources */, D260105D23D0BCD400764D80 /* Stack.swift in Sources */, 0A7EF85D23D8A95600B2AAD1 /* TextEntryFieldModel.swift in Sources */, diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Bill.swift b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Bill.swift new file mode 100644 index 00000000..68c696e0 --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Bill.swift @@ -0,0 +1,76 @@ +// +// HeadersH1Bill.swift +// MVMCoreUI +// +// Created by Lekshmi S on 09/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class HeadersH1Bill: View { + //-------------------------------------------------- + // MARK: - Outlets + //-------------------------------------------------- + let headline = Label.commonLabelH1(true) + let headline2 = Label.commonLabelH1(true) + let subHeadline = Label.commonLabelB3(true) + let body = Label.commonLabelB2(true) + let link = Link() + let buttons = TwoButtonView(frame: .zero) + var stack = Stack(frame: .zero) + + //-------------------------------------------------- + // MARK: - Constants + //-------------------------------------------------- + let spacingBetweenHeadlineHeadline2: CGFloat = 9.0 + let spacingBetweenHeadlin2esubHeadline: CGFloat = 24.0 + let spacingBetweenSubHeadlineBodyLink: CGFloat = 8.0 + let spacingBetweenLinkButtons: CGFloat = 129.0 + + + //------------------------------------------------------- + // MARK: - View Lifecycle + //------------------------------------------------------- + open override func setupView() { + super.setupView() + stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), + (view: headline2, model: StackItemModel(spacing: spacingBetweenHeadlineHeadline2, horizontalAlignment: .leading)), (view: subHeadline, model: StackItemModel(spacing: spacingBetweenHeadlin2esubHeadline, horizontalAlignment: .leading)), (view: body, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: link, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: buttons, model: StackItemModel(spacing: spacingBetweenLinkButtons, horizontalAlignment: .leading))], axis: .vertical) + addSubview(stack) + NSLayoutConstraint.constraintPinSubview(toSuperview: stack) + } + + open override func updateView(_ size: CGFloat) { + super.updateView(size) + stack.updateView(size) + } + + //---------------------------------------------------- + // MARK: - Molecule + //------------------------------------------------------ + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { + super.set(with: model, delegateObject, additionalData) + guard let model = model as? HeadersH1BillModel else { return } + headline.set(with: model.headline, delegateObject, additionalData) + headline2.set(with: model.headline2, delegateObject, additionalData) + subHeadline.set(with: model.subHeadline, delegateObject, additionalData) + body.set(with: model.body, delegateObject, additionalData) + link.set(with: model.link, delegateObject, additionalData) + buttons.set(with: model.buttons, delegateObject, additionalData) + stack.restack() + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 121 + } + + open override func reset() { + super.reset() + headline.styleH1(true) + headline2.styleH1(true) + subHeadline.styleB3(true) + body.styleB2(true) + link.reset() + buttons.reset() + } +} diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1BillModel.swift b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1BillModel.swift new file mode 100644 index 00000000..168f63ae --- /dev/null +++ b/MVMCoreUI/Molecules/DesignedComponents/HeadersH1BillModel.swift @@ -0,0 +1,76 @@ +// +// HeadersH1BillModel.swift +// MVMCoreUI +// +// Created by Lekshmi S on 09/03/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class HeadersH1BillModel: MoleculeModelProtocol { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + + public static var identifier: String = "headerH1Bill" + public var backgroundColor: Color? + public var headline: LabelModel + public var headline2: LabelModel + public var subHeadline: LabelModel + public var body: LabelModel + public var link: LinkModel + public var buttons: TwoButtonViewModel + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public init(headline: LabelModel, headline2: LabelModel, subHeadline: LabelModel, body: LabelModel, link: LinkModel, buttons: TwoButtonViewModel) { + self.headline = headline + self.headline2 = headline2 + self.subHeadline = subHeadline + self.body = body + self.link = link + self.buttons = buttons + } + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + private enum CodingKeys: String, CodingKey { + case moleculeName + case backgroundColor + case headline + case headline2 + case subHeadline + case body + case link + case buttons + } + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) + headline = try typeContainer.decode(LabelModel.self, forKey: .headline) + headline2 = try typeContainer.decode(LabelModel.self, forKey: .headline2) + subHeadline = try typeContainer.decode(LabelModel.self, forKey: .subHeadline) + body = try typeContainer.decode(LabelModel.self, forKey: .body) + link = try typeContainer.decode(LinkModel.self, forKey: .link) + buttons = try typeContainer.decode(TwoButtonViewModel.self, forKey: .buttons) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + try container.encode(headline, forKey: .headline) + try container.encode(headline2, forKey: .headline2) + try container.encode(subHeadline, forKey: .subHeadline) + try container.encode(body, forKey: .body) + try container.encode(link, forKey: .link) + try container.encode(buttons, forKey: .buttons) + } +} diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index 003b5d03..2b8eaa88 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -109,6 +109,7 @@ import Foundation // Designed Section Dividers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnPlanDataDivider.self, viewModelClass: ListThreeColumnPlanDataDividerModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH1Bill.self, viewModelClass: HeadersH1BillModel.self) // TODO: Need model MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(DigitEntryField.self, forKey: "digitTextField" as NSString) From f58b57e145900ee68dec07dae007f9356cd96f27 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 18 Mar 2020 10:04:37 +0530 Subject: [PATCH 05/80] Folder structure changes and conforming to headerView and headermodel --- MVMCoreUI.xcodeproj/project.pbxproj | 12 ++++++------ .../{ => Headers}/HeadersH1Button.swift | 16 +++++----------- .../{ => Headers}/HeadersH1ButtonModel.swift | 14 ++++++-------- .../OtherHandlers/MoleculeObjectMapping.swift | 3 +-- 4 files changed, 18 insertions(+), 27 deletions(-) rename MVMCoreUI/Molecules/DesignedComponents/{ => Headers}/HeadersH1Button.swift (79%) rename MVMCoreUI/Molecules/DesignedComponents/{ => Headers}/HeadersH1ButtonModel.swift (82%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 44bed63f..5b69472d 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -175,10 +175,10 @@ AA119DEA240FB430005F98FD /* HeadersH1ButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; - BB47A586241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */; }; - BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */; }; AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */; }; AAA74A192410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */; }; + BB47A586241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */; }; + BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */; }; C003506123AA94CD00B6AC29 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003506023AA94CD00B6AC29 /* Button.swift */; }; C07065C42395677300FBF997 /* Link.swift in Sources */ = {isa = PBXBuildFile; fileRef = C07065C32395677300FBF997 /* Link.swift */; }; C695A67F23C9830600BFB94E /* UnOrderedListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */; }; @@ -554,10 +554,10 @@ AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1ButtonModel.swift; sourceTree = ""; }; AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = ""; }; AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = ""; }; - BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsectionModel.swift; sourceTree = ""; }; - BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsection.swift; sourceTree = ""; }; AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyText.swift; sourceTree = ""; }; AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyTextModel.swift; sourceTree = ""; }; + BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsectionModel.swift; sourceTree = ""; }; + BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsection.swift; sourceTree = ""; }; C003506023AA94CD00B6AC29 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; C07065C32395677300FBF997 /* Link.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Link.swift; sourceTree = ""; }; C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnOrderedListModel.swift; sourceTree = ""; }; @@ -898,6 +898,8 @@ children = ( AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */, AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */, + AA119DE7240FB41C005F98FD /* HeadersH1Button.swift */, + AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */, ); path = Headers; sourceTree = ""; @@ -1159,8 +1161,6 @@ 525239C32407FFCC00454969 /* LockUps */, D22B38EC23F4E10700490EF6 /* SectionDividers */, D22B38EA23F4E08B00490EF6 /* List */, - AA119DE7240FB41C005F98FD /* HeadersH1Button.swift */, - AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */, ); path = DesignedComponents; sourceTree = ""; diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1Button.swift similarity index 79% rename from MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift rename to MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1Button.swift index 0600cf1e..0abf9673 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Button.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1Button.swift @@ -8,14 +8,13 @@ import Foundation -@objcMembers open class HeadersH1Button: View { +@objcMembers open class HeadersH1Button: HeaderView { //-------------------------------------------------- // MARK: - Outlets //-------------------------------------------------- let headlineBody = HeadlineBody(frame: .zero) let button = PrimaryButton.button() var stack = Stack(frame: .zero) - var spacingBetwenHeadlineBodyAndButton: CGFloat = 72.0 //------------------------------------------------------- // MARK: - View Lifecycle @@ -23,14 +22,10 @@ import Foundation open override func setupView() { super.setupView() stack = Stack.createStack(with: [(view: headlineBody, model: StackItemModel(horizontalAlignment: .leading)), - (view: button, model: StackItemModel(spacing: spacingBetwenHeadlineBodyAndButton, horizontalAlignment: .leading))], axis: .vertical) - addSubview(stack) - NSLayoutConstraint.constraintPinSubview(toSuperview: stack) - } - - open override func updateView(_ size: CGFloat) { - super.updateView(size) - stack.updateView(size) + (view: button, model: StackItemModel(spacing: 72, horizontalAlignment: .leading))], axis: .vertical) + headlineBody.styleLandingPageHeader() + addMolecule(stack) + stack.restack() } //---------------------------------------------------- @@ -41,7 +36,6 @@ import Foundation guard let model = model as? HeadersH1ButtonModel else { return } headlineBody.set(with: model.headlineBody, delegateObject, additionalData) button.set(with: model.button, delegateObject, additionalData) - stack.restack() } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1ButtonModel.swift b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift similarity index 82% rename from MVMCoreUI/Molecules/DesignedComponents/HeadersH1ButtonModel.swift rename to MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift index 48e639a4..d008bab2 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1ButtonModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift @@ -8,22 +8,21 @@ import Foundation -public class HeadersH1ButtonModel: MoleculeModelProtocol { +public class HeadersH1ButtonModel: HeaderModel, MoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- - public static var identifier: String = "headerH1Btn" - public var backgroundColor: Color? public var headlineBody: HeadlineBodyModel public var button: ButtonModel - + //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- public init(headlineBody: HeadlineBodyModel, button: ButtonModel) { self.headlineBody = headlineBody self.button = button + super.init() } //-------------------------------------------------- @@ -31,7 +30,6 @@ public class HeadersH1ButtonModel: MoleculeModelProtocol { //-------------------------------------------------- private enum CodingKeys: String, CodingKey { case moleculeName - case backgroundColor case headlineBody case button } @@ -41,15 +39,15 @@ public class HeadersH1ButtonModel: MoleculeModelProtocol { //-------------------------------------------------- required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody) button = try typeContainer.decode(ButtonModel.self, forKey: .button) + try super.init(from: decoder) } - public func encode(to encoder: Encoder) throws { + public override func encode(to encoder: Encoder) throws { + try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(moleculeName, forKey: .moleculeName) - try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encode(headlineBody, forKey: .headlineBody) try container.encode(button, forKey: .button) } diff --git a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift index 2c89d4b5..26abaccc 100644 --- a/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift +++ b/MVMCoreUI/OtherHandlers/MoleculeObjectMapping.swift @@ -111,8 +111,6 @@ import Foundation MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDetails.self, viewModelClass: ListTwoColumnPriceDetailsModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDescription.self, viewModelClass: ListTwoColumnPriceDescriptionModel.self) - MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH1Button.self, viewModelClass: HeadersH1ButtonModel.self) - // Designed Section Dividers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self) MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnPlanDataDivider.self, viewModelClass: ListThreeColumnPlanDataDividerModel.self) @@ -120,6 +118,7 @@ import Foundation // Designed Headers MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) + MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH1Button.self, viewModelClass: HeadersH1ButtonModel.self) // TODO: Need model MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(MVMCoreUIPageControl.self, forKey: "barsPager" as NSString) From 5eb396092674ddf3a4f43a46c757770473ab3324 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 18 Mar 2020 16:49:45 +0530 Subject: [PATCH 06/80] Folder structure changes and conforming to headerView and headermodel. --- MVMCoreUI.xcodeproj/project.pbxproj | 20 +++++++++---------- .../{ => Headers}/HeadersH1Bill.swift | 13 +++--------- .../{ => Headers}/HeadersH1BillModel.swift | 12 +++++------ 3 files changed, 18 insertions(+), 27 deletions(-) rename MVMCoreUI/Molecules/DesignedComponents/{ => Headers}/HeadersH1Bill.swift (92%) rename MVMCoreUI/Molecules/DesignedComponents/{ => Headers}/HeadersH1BillModel.swift (88%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 9c3293cd..4b5e5103 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -173,12 +173,12 @@ 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; - BB47A586241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */; }; - BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */; }; - AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */; }; - AAA74A192410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */; }; AA3CA8D0241627CE008BF379 /* HeadersH1Bill.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */; }; AA3CA8D2241627DB008BF379 /* HeadersH1BillModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */; }; + AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */; }; + AAA74A192410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */; }; + BB47A586241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */; }; + BB47A588241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */; }; C003506123AA94CD00B6AC29 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003506023AA94CD00B6AC29 /* Button.swift */; }; C07065C42395677300FBF997 /* Link.swift in Sources */ = {isa = PBXBuildFile; fileRef = C07065C32395677300FBF997 /* Link.swift */; }; C695A67F23C9830600BFB94E /* UnOrderedListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */; }; @@ -552,12 +552,12 @@ 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = ""; }; AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = ""; }; - BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsectionModel.swift; sourceTree = ""; }; - BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsection.swift; sourceTree = ""; }; - AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyText.swift; sourceTree = ""; }; - AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyTextModel.swift; sourceTree = ""; }; AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Bill.swift; sourceTree = ""; }; AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1BillModel.swift; sourceTree = ""; }; + AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyText.swift; sourceTree = ""; }; + AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyTextModel.swift; sourceTree = ""; }; + BB47A585241615EF002BB23C /* ListOneColumnFullWidthTextDividerSubsectionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsectionModel.swift; sourceTree = ""; }; + BB47A587241615FA002BB23C /* ListOneColumnFullWidthTextDividerSubsection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextDividerSubsection.swift; sourceTree = ""; }; C003506023AA94CD00B6AC29 /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; }; C07065C32395677300FBF997 /* Link.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Link.swift; sourceTree = ""; }; C695A67E23C9830600BFB94E /* UnOrderedListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnOrderedListModel.swift; sourceTree = ""; }; @@ -898,6 +898,8 @@ children = ( AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */, AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */, + AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */, + AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */, ); path = Headers; sourceTree = ""; @@ -1159,8 +1161,6 @@ 525239C32407FFCC00454969 /* LockUps */, D22B38EC23F4E10700490EF6 /* SectionDividers */, D22B38EA23F4E08B00490EF6 /* List */, - AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */, - AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */, ); path = DesignedComponents; sourceTree = ""; diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Bill.swift b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1Bill.swift similarity index 92% rename from MVMCoreUI/Molecules/DesignedComponents/HeadersH1Bill.swift rename to MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1Bill.swift index 68c696e0..73879617 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1Bill.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1Bill.swift @@ -8,7 +8,7 @@ import Foundation -@objcMembers open class HeadersH1Bill: View { +@objcMembers open class HeadersH1Bill: HeaderView { //-------------------------------------------------- // MARK: - Outlets //-------------------------------------------------- @@ -28,7 +28,6 @@ import Foundation let spacingBetweenSubHeadlineBodyLink: CGFloat = 8.0 let spacingBetweenLinkButtons: CGFloat = 129.0 - //------------------------------------------------------- // MARK: - View Lifecycle //------------------------------------------------------- @@ -36,13 +35,8 @@ import Foundation super.setupView() stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), (view: headline2, model: StackItemModel(spacing: spacingBetweenHeadlineHeadline2, horizontalAlignment: .leading)), (view: subHeadline, model: StackItemModel(spacing: spacingBetweenHeadlin2esubHeadline, horizontalAlignment: .leading)), (view: body, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: link, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: buttons, model: StackItemModel(spacing: spacingBetweenLinkButtons, horizontalAlignment: .leading))], axis: .vertical) - addSubview(stack) - NSLayoutConstraint.constraintPinSubview(toSuperview: stack) - } - - open override func updateView(_ size: CGFloat) { - super.updateView(size) - stack.updateView(size) + addMolecule(stack) + stack.restack() } //---------------------------------------------------- @@ -57,7 +51,6 @@ import Foundation body.set(with: model.body, delegateObject, additionalData) link.set(with: model.link, delegateObject, additionalData) buttons.set(with: model.buttons, delegateObject, additionalData) - stack.restack() } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { diff --git a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1BillModel.swift b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1BillModel.swift similarity index 88% rename from MVMCoreUI/Molecules/DesignedComponents/HeadersH1BillModel.swift rename to MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1BillModel.swift index 168f63ae..d901b38c 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/HeadersH1BillModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/Headers/HeadersH1BillModel.swift @@ -8,13 +8,11 @@ import Foundation -public class HeadersH1BillModel: MoleculeModelProtocol { +public class HeadersH1BillModel: HeaderModel, MoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- - public static var identifier: String = "headerH1Bill" - public var backgroundColor: Color? public var headline: LabelModel public var headline2: LabelModel public var subHeadline: LabelModel @@ -32,6 +30,7 @@ public class HeadersH1BillModel: MoleculeModelProtocol { self.body = body self.link = link self.buttons = buttons + super.init() } //-------------------------------------------------- @@ -39,7 +38,6 @@ public class HeadersH1BillModel: MoleculeModelProtocol { //-------------------------------------------------- private enum CodingKeys: String, CodingKey { case moleculeName - case backgroundColor case headline case headline2 case subHeadline @@ -53,19 +51,19 @@ public class HeadersH1BillModel: MoleculeModelProtocol { //-------------------------------------------------- required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) headline = try typeContainer.decode(LabelModel.self, forKey: .headline) headline2 = try typeContainer.decode(LabelModel.self, forKey: .headline2) subHeadline = try typeContainer.decode(LabelModel.self, forKey: .subHeadline) body = try typeContainer.decode(LabelModel.self, forKey: .body) link = try typeContainer.decode(LinkModel.self, forKey: .link) buttons = try typeContainer.decode(TwoButtonViewModel.self, forKey: .buttons) + try super.init(from: decoder) } - public func encode(to encoder: Encoder) throws { + public override func encode(to encoder: Encoder) throws { + try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(moleculeName, forKey: .moleculeName) - try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encode(headline, forKey: .headline) try container.encode(headline2, forKey: .headline2) try container.encode(subHeadline, forKey: .subHeadline) From 55c841d99229d52b19bb6ff280b12266f0396d32 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 15 Apr 2020 17:50:54 +0530 Subject: [PATCH 07/80] Restructured folder after merge from develop. --- MVMCoreUI.xcodeproj/project.pbxproj | 16 ++++++++-------- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 + .../Headers/HeadersH1Button.swift | 5 ++--- .../Headers/HeadersH1ButtonModel.swift | 0 4 files changed, 11 insertions(+), 11 deletions(-) rename MVMCoreUI/Atomic/Molecules/{HorizontalCombinationViews => }/DesignedComponents/Headers/HeadersH1Button.swift (90%) rename MVMCoreUI/Atomic/Molecules/{HorizontalCombinationViews => }/DesignedComponents/Headers/HeadersH1ButtonModel.swift (100%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index f33cb87a..ffba12b8 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -184,8 +184,8 @@ 94F217B723E0BF6100A47C06 /* PrimaryButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */; }; 94FB966223D797DA003D482B /* MFTextButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 94FB966023D797DA003D482B /* MFTextButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; - AA119DE8240FB41C005F98FD /* HeadersH1Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA119DE7240FB41C005F98FD /* HeadersH1Button.swift */; }; - AA119DEA240FB430005F98FD /* HeadersH1ButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */; }; + AA104AC724472DB0004D2810 /* HeadersH1Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AC624472DB0004D2810 /* HeadersH1Button.swift */; }; + AA104AC924472DC7004D2810 /* HeadersH1ButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; AA1EC59724373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA1EC59624373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift */; }; @@ -612,8 +612,8 @@ 94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PrimaryButtonView.m; sourceTree = ""; }; 94FB966023D797DA003D482B /* MFTextButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFTextButton.h; sourceTree = ""; }; 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; - AA119DE7240FB41C005F98FD /* HeadersH1Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Button.swift; sourceTree = ""; }; - AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1ButtonModel.swift; sourceTree = ""; }; + AA104AC624472DB0004D2810 /* HeadersH1Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Button.swift; sourceTree = ""; }; + AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1ButtonModel.swift; sourceTree = ""; }; AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = ""; }; AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = ""; }; AA1EC59624373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnSpeedTestDividerModel.swift; sourceTree = ""; }; @@ -998,8 +998,8 @@ children = ( AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */, AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */, - AA119DE7240FB41C005F98FD /* HeadersH1Button.swift */, - AA119DE9240FB430005F98FD /* HeadersH1ButtonModel.swift */, + AA104AC624472DB0004D2810 /* HeadersH1Button.swift */, + AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */, ); path = Headers; sourceTree = ""; @@ -2200,7 +2200,6 @@ 94FB966323D797DA003D482B /* MFTextButton.m in Sources */, D29C94D5242901C9003813BA /* MVMCoreUICommonViewsUtility+Extension.swift in Sources */, D260105323CEA61600764D80 /* ToggleModel.swift in Sources */, - AA119DEA240FB430005F98FD /* HeadersH1ButtonModel.swift in Sources */, 014AA72523C501E2006F3E93 /* ContainerModel.swift in Sources */, 0A7EF86523D8AFFF00B2AAD1 /* ItemDropdownEntryFieldModel.swift in Sources */, D29DF2EF21ECEAE1003B2FB9 /* MFFonts.m in Sources */, @@ -2275,6 +2274,7 @@ AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */, 522679C223FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinksModel.swift in Sources */, 8D084AD02410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift in Sources */, + AA104AC924472DC7004D2810 /* HeadersH1ButtonModel.swift in Sources */, 0ABD1371237DB0450081388D /* ItemDropdownEntryField.swift in Sources */, 8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */, BBAA4F03243D8E3B005AAD5F /* RadioBoxes.swift in Sources */, @@ -2319,7 +2319,6 @@ 0AE98BB723FF18E9004C5109 /* ArrowModel.swift in Sources */, D28A837D23CCA86A00DFE4FC /* TabsListItemModel.swift in Sources */, 012A88C6238DA34000FE3DA1 /* ModuleMoleculeModel.swift in Sources */, - AA119DE8240FB41C005F98FD /* HeadersH1Button.swift in Sources */, 94C2D9A123872BCC0006CF46 /* LabelAttributeUnderlineModel.swift in Sources */, D20A9A5E2243D3E300ADE781 /* TwoButtonView.swift in Sources */, D2B1E3E522F37D6A0065F95C /* ImageHeadlineBody.swift in Sources */, @@ -2337,6 +2336,7 @@ BB54C5202434D92F0038326C /* ListRightVariableButtonAllTextAndLinks.swift in Sources */, 948DB67E2326DCD90011F916 /* MultiProgress.swift in Sources */, 013F801923FB4A8E00AD8013 /* UIContentMode+Extension.swift in Sources */, + AA104AC724472DB0004D2810 /* HeadersH1Button.swift in Sources */, 525239C22407BD1000454969 /* ListTwoColumnPriceDetails.swift in Sources */, D2A5146122121FBF00345BFB /* MoleculeStackTemplate.swift in Sources */, D2E2A9A323E096B1000B42E6 /* DisableableModelProtocol.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index ab0d5b43..ffa26033 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -163,6 +163,7 @@ import Foundation // Designed Headers MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1Button.self, viewModelClass: HeadersH1ButtonModel.self) // TODO: Need View try? ModelRegistry.register(TabsModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1Button.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift similarity index 90% rename from MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1Button.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift index 0abf9673..a7534e1a 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1Button.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift @@ -13,7 +13,7 @@ import Foundation // MARK: - Outlets //-------------------------------------------------- let headlineBody = HeadlineBody(frame: .zero) - let button = PrimaryButton.button() + let button = PillButton(frame: .zero) var stack = Stack(frame: .zero) //------------------------------------------------------- @@ -21,8 +21,7 @@ import Foundation //------------------------------------------------------- open override func setupView() { super.setupView() - stack = Stack.createStack(with: [(view: headlineBody, model: StackItemModel(horizontalAlignment: .leading)), - (view: button, model: StackItemModel(spacing: 72, horizontalAlignment: .leading))], axis: .vertical) + stack = Stack.createStack(with: [(view: headlineBody, model: StackItemModel(horizontalAlignment: .leading)), (view: button, model: StackItemModel(spacing: 72, horizontalAlignment: .leading))], axis: .vertical) headlineBody.styleLandingPageHeader() addMolecule(stack) stack.restack() diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1ButtonModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1ButtonModel.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift From 9760953004358838c3c9a76fb51bf2b522a4829d Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 15 Apr 2020 18:00:14 +0530 Subject: [PATCH 08/80] Restructured folder after merge from develop. --- MVMCoreUI.xcodeproj/project.pbxproj | 16 ++++++++-------- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 + .../Headers/HeadersH1Bill.swift | 0 .../Headers/HeadersH1BillModel.swift | 0 4 files changed, 9 insertions(+), 8 deletions(-) rename MVMCoreUI/Atomic/Molecules/{HorizontalCombinationViews => }/DesignedComponents/Headers/HeadersH1Bill.swift (100%) rename MVMCoreUI/Atomic/Molecules/{HorizontalCombinationViews => }/DesignedComponents/Headers/HeadersH1BillModel.swift (100%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index bd526826..1c9ce337 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -184,14 +184,14 @@ 94F217B723E0BF6100A47C06 /* PrimaryButtonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */; }; 94FB966223D797DA003D482B /* MFTextButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 94FB966023D797DA003D482B /* MFTextButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; + AA104ADA244734DB004D2810 /* HeadersH1Bill.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AD9244734DB004D2810 /* HeadersH1Bill.swift */; }; + AA104ADC244734EA004D2810 /* HeadersH1BillModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104ADB244734EA004D2810 /* HeadersH1BillModel.swift */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; AA1EC59724373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA1EC59624373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift */; }; AA1EC59924373994003D6F50 /* ListThreeColumnSpeedTestDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA1EC59824373994003D6F50 /* ListThreeColumnSpeedTestDivider.swift */; }; AA56A20F243C5EE900303286 /* ListTwoColumnSubsectionDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA56A20E243C5EE900303286 /* ListTwoColumnSubsectionDividerModel.swift */; }; AA56A211243C5EFC00303286 /* ListTwoColumnSubsectionDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA56A210243C5EFC00303286 /* ListTwoColumnSubsectionDivider.swift */; }; - AA3CA8D0241627CE008BF379 /* HeadersH1Bill.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */; }; - AA3CA8D2241627DB008BF379 /* HeadersH1BillModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */; }; AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */; }; AAA74A192410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */; }; BB2C968F24330EA7006FF80C /* ListRightVariableTextLinkAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB2C968D24330EA7006FF80C /* ListRightVariableTextLinkAllTextAndLinksModel.swift */; }; @@ -612,14 +612,14 @@ 94F217B523E0BF6100A47C06 /* PrimaryButtonView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PrimaryButtonView.m; sourceTree = ""; }; 94FB966023D797DA003D482B /* MFTextButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFTextButton.h; sourceTree = ""; }; 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; + AA104AD9244734DB004D2810 /* HeadersH1Bill.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Bill.swift; sourceTree = ""; }; + AA104ADB244734EA004D2810 /* HeadersH1BillModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1BillModel.swift; sourceTree = ""; }; AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = ""; }; AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = ""; }; AA1EC59624373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnSpeedTestDividerModel.swift; sourceTree = ""; }; AA1EC59824373994003D6F50 /* ListThreeColumnSpeedTestDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnSpeedTestDivider.swift; sourceTree = ""; }; AA56A20E243C5EE900303286 /* ListTwoColumnSubsectionDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnSubsectionDividerModel.swift; sourceTree = ""; }; AA56A210243C5EFC00303286 /* ListTwoColumnSubsectionDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnSubsectionDivider.swift; sourceTree = ""; }; - AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Bill.swift; sourceTree = ""; }; - AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1BillModel.swift; sourceTree = ""; }; AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyText.swift; sourceTree = ""; }; AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyTextModel.swift; sourceTree = ""; }; BB2C968D24330EA7006FF80C /* ListRightVariableTextLinkAllTextAndLinksModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListRightVariableTextLinkAllTextAndLinksModel.swift; sourceTree = ""; }; @@ -998,8 +998,8 @@ children = ( AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */, AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */, - AA3CA8CF241627CE008BF379 /* HeadersH1Bill.swift */, - AA3CA8D1241627DB008BF379 /* HeadersH1BillModel.swift */, + AA104AD9244734DB004D2810 /* HeadersH1Bill.swift */, + AA104ADB244734EA004D2810 /* HeadersH1BillModel.swift */, ); path = Headers; sourceTree = ""; @@ -2133,7 +2133,6 @@ D29DF27621E79E81003B2FB9 /* MVMCoreUILoggingHandler.m in Sources */, C695A69623C990BC00BFB94E /* DoughnutChart.swift in Sources */, 014AA72D23C5059B006F3E93 /* StackPageTemplateModel.swift in Sources */, - AA3CA8D0241627CE008BF379 /* HeadersH1Bill.swift in Sources */, D260106123D0C02A00764D80 /* StackItemModelProtocol.swift in Sources */, 0AE98BAF23FEF956004C5109 /* ExternalLink.swift in Sources */, 012A88C4238D86E600FE3DA1 /* CarouselItemModelProtocol.swift in Sources */, @@ -2181,6 +2180,7 @@ D2A92886241ACD99004E01C6 /* ProgrammaticTableViewController.swift in Sources */, BBAA4F05243D8E3B005AAD5F /* RadioBoxesModel.swift in Sources */, 01509D952327ED1900EF99AA /* HeadlineBodyLinkToggle.swift in Sources */, + AA104ADA244734DB004D2810 /* HeadersH1Bill.swift in Sources */, 31BE15CB23D8924D00452370 /* CheckboxLabelModel.swift in Sources */, D29DF13021E6851E003B2FB9 /* MVMCoreUITopAlertShortView.m in Sources */, 5248BFEC23F12E350059236A /* ListThreeColumnPlanDataDivider.swift in Sources */, @@ -2207,7 +2207,6 @@ D22479942316AE5E003FCCF9 /* NSLayoutConstraintExtension.swift in Sources */, D2B18B94236214AD00A9AEDC /* NavigationController.swift in Sources */, D29E28DA23D21AFA00ACEA85 /* StringAndMoleculeModel.swift in Sources */, - AA3CA8D2241627DB008BF379 /* HeadersH1BillModel.swift in Sources */, D282AACB2243C61700C46919 /* ButtonView.swift in Sources */, D260105D23D0BCD400764D80 /* Stack.swift in Sources */, 0A7EF85D23D8A95600B2AAD1 /* TextEntryFieldModel.swift in Sources */, @@ -2278,6 +2277,7 @@ 8D084AD02410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift in Sources */, 0ABD1371237DB0450081388D /* ItemDropdownEntryField.swift in Sources */, 8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */, + AA104ADC244734EA004D2810 /* HeadersH1BillModel.swift in Sources */, BBAA4F03243D8E3B005AAD5F /* RadioBoxes.swift in Sources */, D2E1FAE12268E81D00AEFD8C /* MoleculeListTemplate.swift in Sources */, 525019E72406853600EED91C /* ListFourColumnDataUsageDivider.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index ab0d5b43..c5ea94d2 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -163,6 +163,7 @@ import Foundation // Designed Headers MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1Bill.self, viewModelClass: HeadersH1BillModel.self) // TODO: Need View try? ModelRegistry.register(TabsModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1Bill.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Bill.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1Bill.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Bill.swift diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1BillModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1BillModel.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/DesignedComponents/Headers/HeadersH1BillModel.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1BillModel.swift From bb87cac010dccbfd4be1a6868ead84f022f13120 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Sun, 26 Apr 2020 00:40:09 +0530 Subject: [PATCH 09/80] removed space --- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index b8ffb9e6..436db9d5 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -118,7 +118,6 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: MoleculeCollectionViewCell.self, viewModelClass: MoleculeCollectionItemModel.self) MoleculeObjectMapping.shared()?.register(viewClass: CarouselItem.self, viewModelClass: CarouselItemModel.self) - // Other Container Molecules MoleculeObjectMapping.shared()?.register(viewClass: MoleculeContainer.self, viewModelClass: MoleculeContainerModel.self) MoleculeObjectMapping.shared()?.register(viewClass: MoleculeHeaderView.self, viewModelClass: MoleculeHeaderModel.self) From 6191dbb1905e31c48ff644be8142887b20102c20 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Sun, 26 Apr 2020 00:43:09 +0530 Subject: [PATCH 10/80] Revert "removed space" This reverts commit bb87cac010dccbfd4be1a6868ead84f022f13120. --- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index 436db9d5..b8ffb9e6 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -118,6 +118,7 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: MoleculeCollectionViewCell.self, viewModelClass: MoleculeCollectionItemModel.self) MoleculeObjectMapping.shared()?.register(viewClass: CarouselItem.self, viewModelClass: CarouselItemModel.self) + // Other Container Molecules MoleculeObjectMapping.shared()?.register(viewClass: MoleculeContainer.self, viewModelClass: MoleculeContainerModel.self) MoleculeObjectMapping.shared()?.register(viewClass: MoleculeHeaderView.self, viewModelClass: MoleculeHeaderModel.self) From f0ec48a691d0542796831226fcbbb32b85c46ed8 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 28 Apr 2020 13:23:49 +0530 Subject: [PATCH 11/80] Code changes and renaming files after confluence update. --- MVMCoreUI.xcodeproj/project.pbxproj | 16 +++++------ MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 2 +- ...swift => HeadersH1LandingPageHeader.swift} | 28 +++++++++---------- ... => HeadersH1LandingPageHeaderModel.swift} | 6 ++-- 4 files changed, 26 insertions(+), 26 deletions(-) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{HeadersH1Bill.swift => HeadersH1LandingPageHeader.swift} (78%) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{HeadersH1BillModel.swift => HeadersH1LandingPageHeaderModel.swift} (93%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 09269ac5..bd90b40d 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -191,8 +191,8 @@ 94F6516D2437954100631BF9 /* Tabs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94F6516C2437954100631BF9 /* Tabs.swift */; }; 94FB966223D797DA003D482B /* MFTextButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 94FB966023D797DA003D482B /* MFTextButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; 94FB966323D797DA003D482B /* MFTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 94FB966123D797DA003D482B /* MFTextButton.m */; }; - AA104ADA244734DB004D2810 /* HeadersH1Bill.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AD9244734DB004D2810 /* HeadersH1Bill.swift */; }; - AA104ADC244734EA004D2810 /* HeadersH1BillModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104ADB244734EA004D2810 /* HeadersH1BillModel.swift */; }; + AA104ADA244734DB004D2810 /* HeadersH1LandingPageHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */; }; + AA104ADC244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; AA1EC59724373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA1EC59624373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift */; }; @@ -647,8 +647,8 @@ 94F6516C2437954100631BF9 /* Tabs.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tabs.swift; sourceTree = ""; }; 94FB966023D797DA003D482B /* MFTextButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFTextButton.h; sourceTree = ""; }; 94FB966123D797DA003D482B /* MFTextButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFTextButton.m; sourceTree = ""; }; - AA104AD9244734DB004D2810 /* HeadersH1Bill.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Bill.swift; sourceTree = ""; }; - AA104ADB244734EA004D2810 /* HeadersH1BillModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1BillModel.swift; sourceTree = ""; }; + AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1LandingPageHeader.swift; sourceTree = ""; }; + AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1LandingPageHeaderModel.swift; sourceTree = ""; }; AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = ""; }; AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = ""; }; AA1EC59624373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnSpeedTestDividerModel.swift; sourceTree = ""; }; @@ -1055,8 +1055,8 @@ children = ( AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */, AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */, - AA104AD9244734DB004D2810 /* HeadersH1Bill.swift */, - AA104ADB244734EA004D2810 /* HeadersH1BillModel.swift */, + AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */, + AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */, ); path = Headers; sourceTree = ""; @@ -2283,7 +2283,7 @@ D2A92886241ACD99004E01C6 /* ProgrammaticTableViewController.swift in Sources */, BBAA4F05243D8E3B005AAD5F /* RadioBoxesModel.swift in Sources */, 01509D952327ED1900EF99AA /* HeadlineBodyLinkToggle.swift in Sources */, - AA104ADA244734DB004D2810 /* HeadersH1Bill.swift in Sources */, + AA104ADA244734DB004D2810 /* HeadersH1LandingPageHeader.swift in Sources */, 31BE15CB23D8924D00452370 /* CheckboxLabelModel.swift in Sources */, D29DF13021E6851E003B2FB9 /* MVMCoreUITopAlertShortView.m in Sources */, 94F6516D2437954100631BF9 /* Tabs.swift in Sources */, @@ -2390,7 +2390,7 @@ 8D084AD02410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift in Sources */, 0ABD1371237DB0450081388D /* ItemDropdownEntryField.swift in Sources */, 8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */, - AA104ADC244734EA004D2810 /* HeadersH1BillModel.swift in Sources */, + AA104ADC244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift in Sources */, BBAA4F03243D8E3B005AAD5F /* RadioBoxes.swift in Sources */, D2E1FAE12268E81D00AEFD8C /* MoleculeListTemplate.swift in Sources */, 525019E72406853600EED91C /* ListFourColumnDataUsageDivider.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index 3c60b5c7..0207c6f6 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -169,7 +169,7 @@ import Foundation // Designed Headers MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) - MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1Bill.self, viewModelClass: HeadersH1BillModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1LandingPageHeader.self, viewModelClass: HeadersH1LandingPageHeaderModel.self) // Device Items MoleculeObjectMapping.shared()?.register(viewClass: ListDeviceComplexButtonMedium.self, viewModelClass: ListDeviceComplexButtonMediumModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Bill.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift similarity index 78% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Bill.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift index 73879617..8ab212b3 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Bill.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift @@ -1,5 +1,5 @@ // -// HeadersH1Bill.swift +// HeadersH1LandingPageHeader.swift // MVMCoreUI // // Created by Lekshmi S on 09/03/20. @@ -8,14 +8,14 @@ import Foundation -@objcMembers open class HeadersH1Bill: HeaderView { +@objcMembers open class HeadersH1LandingPageHeader: HeaderView { //-------------------------------------------------- // MARK: - Outlets //-------------------------------------------------- - let headline = Label.commonLabelH1(true) - let headline2 = Label.commonLabelH1(true) - let subHeadline = Label.commonLabelB3(true) - let body = Label.commonLabelB2(true) + let headline = Label.createLabelTitle2XLarge(true) + let headline2 = Label.createLabelTitle2XLarge(true) + let subHeadline = Label.createLabelBoldBodySmall(true) + let body = Label.createLabelRegularBodySmall(true) let link = Link() let buttons = TwoButtonView(frame: .zero) var stack = Stack(frame: .zero) @@ -23,10 +23,10 @@ import Foundation //-------------------------------------------------- // MARK: - Constants //-------------------------------------------------- - let spacingBetweenHeadlineHeadline2: CGFloat = 9.0 - let spacingBetweenHeadlin2esubHeadline: CGFloat = 24.0 + let spacingBetweenHeadlineHeadline2: CGFloat = 16.0 + let spacingBetweenHeadlin2esubHeadline: CGFloat = 32.0 let spacingBetweenSubHeadlineBodyLink: CGFloat = 8.0 - let spacingBetweenLinkButtons: CGFloat = 129.0 + let spacingBetweenLinkButtons: CGFloat = 128.0 //------------------------------------------------------- // MARK: - View Lifecycle @@ -44,7 +44,7 @@ import Foundation //------------------------------------------------------ open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { super.set(with: model, delegateObject, additionalData) - guard let model = model as? HeadersH1BillModel else { return } + guard let model = model as? HeadersH1LandingPageHeaderModel else { return } headline.set(with: model.headline, delegateObject, additionalData) headline2.set(with: model.headline2, delegateObject, additionalData) subHeadline.set(with: model.subHeadline, delegateObject, additionalData) @@ -59,10 +59,10 @@ import Foundation open override func reset() { super.reset() - headline.styleH1(true) - headline2.styleH1(true) - subHeadline.styleB3(true) - body.styleB2(true) + headline.styleTitle2XLarge(true) + headline2.styleTitle2XLarge(true) + subHeadline.styleBoldBodySmall(true) + body.styleRegularBodySmall(true) link.reset() buttons.reset() } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1BillModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeaderModel.swift similarity index 93% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1BillModel.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeaderModel.swift index d901b38c..d7603886 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1BillModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeaderModel.swift @@ -1,5 +1,5 @@ // -// HeadersH1BillModel.swift +// HeadersH1LandingPageHeaderModel.swift // MVMCoreUI // // Created by Lekshmi S on 09/03/20. @@ -8,11 +8,11 @@ import Foundation -public class HeadersH1BillModel: HeaderModel, MoleculeModelProtocol { +public class HeadersH1LandingPageHeaderModel: HeaderModel, MoleculeModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- - public static var identifier: String = "headerH1Bill" + public static var identifier: String = "headerH1Landing" public var headline: LabelModel public var headline2: LabelModel public var subHeadline: LabelModel From a32c46e432a42da8dbca046098dac450d2fdf8ce Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 28 Apr 2020 14:13:16 +0530 Subject: [PATCH 12/80] Code cleanup --- .../Headers/HeadersH1LandingPageHeader.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift index 8ab212b3..ac09dc07 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift @@ -12,13 +12,13 @@ import Foundation //-------------------------------------------------- // MARK: - Outlets //-------------------------------------------------- - let headline = Label.createLabelTitle2XLarge(true) - let headline2 = Label.createLabelTitle2XLarge(true) - let subHeadline = Label.createLabelBoldBodySmall(true) - let body = Label.createLabelRegularBodySmall(true) - let link = Link() - let buttons = TwoButtonView(frame: .zero) - var stack = Stack(frame: .zero) + public let headline = Label.createLabelTitle2XLarge(true) + public let headline2 = Label.createLabelTitle2XLarge(true) + public let subHeadline = Label.createLabelBoldBodySmall(true) + public let body = Label.createLabelRegularBodySmall(true) + public let link = Link() + public let buttons = TwoButtonView(frame: .zero) + public var stack = Stack(frame: .zero) //-------------------------------------------------- // MARK: - Constants From a8051bf29e9271acd6e4f9bef51b1e917001d0ac Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Fri, 5 Jun 2020 15:51:34 +0530 Subject: [PATCH 13/80] Code cleanup --- .../DesignedComponents/Headers/HeadersH1LandingPageHeader.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift index ac09dc07..388b70be 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift @@ -63,7 +63,5 @@ import Foundation headline2.styleTitle2XLarge(true) subHeadline.styleBoldBodySmall(true) body.styleRegularBodySmall(true) - link.reset() - buttons.reset() } } From b7f82ae29f4d3bde921136a3d76c1af03bb8987d Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Fri, 5 Jun 2020 15:56:46 +0530 Subject: [PATCH 14/80] Model placed above view. --- MVMCoreUI.xcodeproj/project.pbxproj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index deb3d015..a136a588 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -185,10 +185,10 @@ 94F6516D2437954100631BF9 /* Tabs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94F6516C2437954100631BF9 /* Tabs.swift */; }; AA0A257824766C8A00862F64 /* ListLeftVariableIconWithRightCaretBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0A257724766C8A00862F64 /* ListLeftVariableIconWithRightCaretBodyTextModel.swift */; }; AA0A257A24766CA200862F64 /* ListLeftVariableIconWithRightCaretBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0A257924766CA200862F64 /* ListLeftVariableIconWithRightCaretBodyText.swift */; }; - AA104B1A24474A66004D2810 /* HeadersH2Buttons.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */; }; - AA104B1C24474A76004D2810 /* HeadersH2ButtonsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */; }; AA104ADA244734DB004D2810 /* HeadersH1LandingPageHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */; }; AA104ADC244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */; }; + AA104B1A24474A66004D2810 /* HeadersH2Buttons.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */; }; + AA104B1C24474A76004D2810 /* HeadersH2ButtonsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; AA1EC59724373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA1EC59624373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift */; }; @@ -624,10 +624,10 @@ 94F6516C2437954100631BF9 /* Tabs.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tabs.swift; sourceTree = ""; }; AA0A257724766C8A00862F64 /* ListLeftVariableIconWithRightCaretBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaretBodyTextModel.swift; sourceTree = ""; }; AA0A257924766CA200862F64 /* ListLeftVariableIconWithRightCaretBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaretBodyText.swift; sourceTree = ""; }; - AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2Buttons.swift; sourceTree = ""; }; - AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2ButtonsModel.swift; sourceTree = ""; }; AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1LandingPageHeader.swift; sourceTree = ""; }; AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1LandingPageHeaderModel.swift; sourceTree = ""; }; + AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2Buttons.swift; sourceTree = ""; }; + AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2ButtonsModel.swift; sourceTree = ""; }; AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = ""; }; AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = ""; }; AA1EC59624373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnSpeedTestDividerModel.swift; sourceTree = ""; }; @@ -1026,8 +1026,8 @@ AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */, AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */, AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */, - AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */, AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */, + AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */, ); path = Headers; sourceTree = ""; From 862fa066dd1dd9413004b2816c22795329cdb9cd Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Mon, 8 Jun 2020 17:28:58 +0530 Subject: [PATCH 15/80] 1. Changing imageName to image as per doc: https://oneconfluence.verizon.com/display/MFD/Navigation+Image+Button --- .../Buttons/NavigationImageButtonModel.swift | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/NavigationBar/Buttons/NavigationImageButtonModel.swift b/MVMCoreUI/Atomic/Molecules/NavigationBar/Buttons/NavigationImageButtonModel.swift index aff9c58f..dc208949 100644 --- a/MVMCoreUI/Atomic/Molecules/NavigationBar/Buttons/NavigationImageButtonModel.swift +++ b/MVMCoreUI/Atomic/Molecules/NavigationBar/Buttons/NavigationImageButtonModel.swift @@ -11,34 +11,34 @@ public class NavigationImageButtonModel: NavigationButtonModelProtocol, Molecule public var backgroundColor: Color? public static var identifier: String = "navigationImageButton" - public var imageName: String + public var image: String public var action: ActionModelProtocol - public init(with imageName: String, action: ActionModelProtocol) { - self.imageName = imageName + public init(with image: String, action: ActionModelProtocol) { + self.image = image self.action = action } private enum CodingKeys: String, CodingKey { - case imageName + case image case action } required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - imageName = try typeContainer.decode(String.self, forKey: .imageName) + image = try typeContainer.decode(String.self, forKey: .image) action = try typeContainer.decodeModel(codingKey: .action) } open func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(imageName, forKey: .imageName) + try container.encode(image, forKey: .image) try container.encodeModel(action, forKey: .action) } /// Convenience function that creates a BarButtonItem for the model. public func createNavigationItemButton(delegateObject: MVMCoreUIDelegateObject? = nil, additionalData: [AnyHashable: Any]? = nil) -> UIBarButtonItem { - let image = UIImage(named: imageName, in: MVMCoreCache.shared()?.bundleToUseForImages(), compatibleWith: nil) - return ImageBarButtonItem.create(with: image, actionModel: action, delegateObject: delegateObject, additionalData: additionalData) + let imageName = UIImage(named: image, in: MVMCoreCache.shared()?.bundleToUseForImages(), compatibleWith: nil) + return ImageBarButtonItem.create(with: imageName, actionModel: action, delegateObject: delegateObject, additionalData: additionalData) } } From df4437a4bee26d5e4b97f36ce6e4d95e1ddad354 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 9 Jun 2020 18:03:39 +0530 Subject: [PATCH 16/80] Changes after latest style code and review comments. --- .../Headers/HeadersH1LandingPageHeader.swift | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift index 388b70be..bd37ed78 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1LandingPageHeader.swift @@ -12,10 +12,10 @@ import Foundation //-------------------------------------------------- // MARK: - Outlets //-------------------------------------------------- - public let headline = Label.createLabelTitle2XLarge(true) - public let headline2 = Label.createLabelTitle2XLarge(true) - public let subHeadline = Label.createLabelBoldBodySmall(true) - public let body = Label.createLabelRegularBodySmall(true) + public let headline = Label(fontStyle: .Title2XLarge) + public let headline2 = Label(fontStyle: .Title2XLarge) + public let subHeadline = Label(fontStyle: .BoldBodySmall) + public let body = Label(fontStyle: .RegularBodySmall) public let link = Link() public let buttons = TwoButtonView(frame: .zero) public var stack = Stack(frame: .zero) @@ -24,7 +24,7 @@ import Foundation // MARK: - Constants //-------------------------------------------------- let spacingBetweenHeadlineHeadline2: CGFloat = 16.0 - let spacingBetweenHeadlin2esubHeadline: CGFloat = 32.0 + let spacingBetweenHeadline2subHeadline: CGFloat = 32.0 let spacingBetweenSubHeadlineBodyLink: CGFloat = 8.0 let spacingBetweenLinkButtons: CGFloat = 128.0 @@ -34,7 +34,7 @@ import Foundation open override func setupView() { super.setupView() stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), - (view: headline2, model: StackItemModel(spacing: spacingBetweenHeadlineHeadline2, horizontalAlignment: .leading)), (view: subHeadline, model: StackItemModel(spacing: spacingBetweenHeadlin2esubHeadline, horizontalAlignment: .leading)), (view: body, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: link, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: buttons, model: StackItemModel(spacing: spacingBetweenLinkButtons, horizontalAlignment: .leading))], axis: .vertical) + (view: headline2, model: StackItemModel(spacing: spacingBetweenHeadlineHeadline2, horizontalAlignment: .leading)), (view: subHeadline, model: StackItemModel(spacing: spacingBetweenHeadline2subHeadline, horizontalAlignment: .leading)), (view: body, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: link, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: buttons, model: StackItemModel(spacing: spacingBetweenLinkButtons))], axis: .vertical) addMolecule(stack) stack.restack() } @@ -59,9 +59,9 @@ import Foundation open override func reset() { super.reset() - headline.styleTitle2XLarge(true) - headline2.styleTitle2XLarge(true) - subHeadline.styleBoldBodySmall(true) - body.styleRegularBodySmall(true) + headline.setFontStyle(.Title2XLarge) + headline2.setFontStyle(.Title2XLarge) + subHeadline.setFontStyle(.BoldBodySmall) + body.setFontStyle(.RegularBodySmall) } } From 18f146f668f03b93fa89faabb188d3bcc3ef192d Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Wed, 10 Jun 2020 00:30:52 +0530 Subject: [PATCH 17/80] making few objects open to use in MF --- MVMCoreUI/BaseClasses/BarButtonItem.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/BaseClasses/BarButtonItem.swift b/MVMCoreUI/BaseClasses/BarButtonItem.swift index 93eb63a3..e979e04f 100644 --- a/MVMCoreUI/BaseClasses/BarButtonItem.swift +++ b/MVMCoreUI/BaseClasses/BarButtonItem.swift @@ -8,9 +8,9 @@ public typealias BarButtonAction = (BarButtonItem) -> () -@objc class ActionDelegate: NSObject { - var buttonAction: BarButtonAction? - @objc func callActionBlock(_ sender: BarButtonItem) { +@objc open class ActionDelegate: NSObject { + open var buttonAction: BarButtonAction? + @objc open func callActionBlock(_ sender: BarButtonItem) { buttonAction?(sender) } } @@ -22,7 +22,7 @@ public typealias BarButtonAction = (BarButtonItem) -> () //-------------------------------------------------- open weak var buttonDelegate: ButtonDelegateProtocol? - var actionDelegate: ActionDelegate? + open var actionDelegate: ActionDelegate? //-------------------------------------------------- // MARK: - Methods From fe12997456253e4b8d0a0eb6c1ac93e39a042618 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Thu, 11 Jun 2020 19:47:23 +0530 Subject: [PATCH 18/80] Code changes as per confluence updates. --- MVMCoreUI.xcodeproj/project.pbxproj | 10 ++++----- .../Headers/HeadersH1Button.swift | 22 ++++++++++++++----- .../Headers/HeadersH1ButtonModel.swift | 16 +++++++------- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index f85266b7..b4c341b7 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -187,10 +187,10 @@ 94F6516D2437954100631BF9 /* Tabs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94F6516C2437954100631BF9 /* Tabs.swift */; }; AA0A257824766C8A00862F64 /* ListLeftVariableIconWithRightCaretBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0A257724766C8A00862F64 /* ListLeftVariableIconWithRightCaretBodyTextModel.swift */; }; AA0A257A24766CA200862F64 /* ListLeftVariableIconWithRightCaretBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0A257924766CA200862F64 /* ListLeftVariableIconWithRightCaretBodyText.swift */; }; - AA104B1A24474A66004D2810 /* HeadersH2Buttons.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */; }; - AA104B1C24474A76004D2810 /* HeadersH2ButtonsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */; }; AA104AC724472DB0004D2810 /* HeadersH1Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AC624472DB0004D2810 /* HeadersH1Button.swift */; }; AA104AC924472DC7004D2810 /* HeadersH1ButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */; }; + AA104B1A24474A66004D2810 /* HeadersH2Buttons.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */; }; + AA104B1C24474A76004D2810 /* HeadersH2ButtonsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */; }; AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; }; AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */; }; AA1EC59724373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA1EC59624373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift */; }; @@ -634,10 +634,10 @@ 94F6516C2437954100631BF9 /* Tabs.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tabs.swift; sourceTree = ""; }; AA0A257724766C8A00862F64 /* ListLeftVariableIconWithRightCaretBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaretBodyTextModel.swift; sourceTree = ""; }; AA0A257924766CA200862F64 /* ListLeftVariableIconWithRightCaretBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaretBodyText.swift; sourceTree = ""; }; - AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2Buttons.swift; sourceTree = ""; }; - AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2ButtonsModel.swift; sourceTree = ""; }; AA104AC624472DB0004D2810 /* HeadersH1Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Button.swift; sourceTree = ""; }; AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1ButtonModel.swift; sourceTree = ""; }; + AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2Buttons.swift; sourceTree = ""; }; + AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2ButtonsModel.swift; sourceTree = ""; }; AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = ""; }; AA11A42023F15D7000D7962F /* ListRightVariablePaymentsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePaymentsModel.swift; sourceTree = ""; }; AA1EC59624373985003D6F50 /* ListThreeColumnSpeedTestDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnSpeedTestDividerModel.swift; sourceTree = ""; }; @@ -1042,8 +1042,8 @@ AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */, AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */, AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */, - AA104AC624472DB0004D2810 /* HeadersH1Button.swift */, AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */, + AA104AC624472DB0004D2810 /* HeadersH1Button.swift */, ); path = Headers; sourceTree = ""; diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift index a7534e1a..eeddf714 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift @@ -12,16 +12,27 @@ import Foundation //-------------------------------------------------- // MARK: - Outlets //-------------------------------------------------- - let headlineBody = HeadlineBody(frame: .zero) - let button = PillButton(frame: .zero) - var stack = Stack(frame: .zero) + public let headlineBody = HeadlineBody(frame: .zero) + public let buttons = TwoButtonView(frame: .zero) + public let stack: Stack + + //------------------------------------------------------- + // MARK: - Initializers + //------------------------------------------------------- + public override init(frame: CGRect) { + stack = Stack.createStack(with: [headlineBody, buttons], spacing: PaddingVerticalWhiteGrayView) + super.init(frame: frame) + } + + public required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } //------------------------------------------------------- // MARK: - View Lifecycle //------------------------------------------------------- open override func setupView() { super.setupView() - stack = Stack.createStack(with: [(view: headlineBody, model: StackItemModel(horizontalAlignment: .leading)), (view: button, model: StackItemModel(spacing: 72, horizontalAlignment: .leading))], axis: .vertical) headlineBody.styleLandingPageHeader() addMolecule(stack) stack.restack() @@ -34,7 +45,7 @@ import Foundation super.set(with: model, delegateObject, additionalData) guard let model = model as? HeadersH1ButtonModel else { return } headlineBody.set(with: model.headlineBody, delegateObject, additionalData) - button.set(with: model.button, delegateObject, additionalData) + buttons.set(with: model.buttons, delegateObject, additionalData) } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { @@ -44,6 +55,5 @@ import Foundation open override func reset() { super.reset() headlineBody.styleLandingPageHeader() - button.reset() } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift index d008bab2..5df94b85 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift @@ -14,24 +14,24 @@ public class HeadersH1ButtonModel: HeaderModel, MoleculeModelProtocol { //-------------------------------------------------- public static var identifier: String = "headerH1Btn" public var headlineBody: HeadlineBodyModel - public var button: ButtonModel - + public var buttons: TwoButtonViewModel + //-------------------------------------------------- // MARK: - Initializer //-------------------------------------------------- - public init(headlineBody: HeadlineBodyModel, button: ButtonModel) { + public init(headlineBody: HeadlineBodyModel, buttons: TwoButtonViewModel) { self.headlineBody = headlineBody - self.button = button + self.buttons = buttons super.init() } - + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- private enum CodingKeys: String, CodingKey { case moleculeName case headlineBody - case button + case buttons } //-------------------------------------------------- @@ -40,7 +40,7 @@ public class HeadersH1ButtonModel: HeaderModel, MoleculeModelProtocol { required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody) - button = try typeContainer.decode(ButtonModel.self, forKey: .button) + buttons = try typeContainer.decode(TwoButtonViewModel.self, forKey: .buttons) try super.init(from: decoder) } @@ -49,6 +49,6 @@ public class HeadersH1ButtonModel: HeaderModel, MoleculeModelProtocol { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(moleculeName, forKey: .moleculeName) try container.encode(headlineBody, forKey: .headlineBody) - try container.encode(button, forKey: .button) + try container.encode(buttons, forKey: .buttons) } } From b3020d9534db24ec11cdda6021e29a51f599669e Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Fri, 12 Jun 2020 00:57:36 +0530 Subject: [PATCH 19/80] Implemented Scott Feedback. Removed open keyword. --- MVMCoreUI/BaseClasses/BarButtonItem.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/BaseClasses/BarButtonItem.swift b/MVMCoreUI/BaseClasses/BarButtonItem.swift index e979e04f..93eb63a3 100644 --- a/MVMCoreUI/BaseClasses/BarButtonItem.swift +++ b/MVMCoreUI/BaseClasses/BarButtonItem.swift @@ -8,9 +8,9 @@ public typealias BarButtonAction = (BarButtonItem) -> () -@objc open class ActionDelegate: NSObject { - open var buttonAction: BarButtonAction? - @objc open func callActionBlock(_ sender: BarButtonItem) { +@objc class ActionDelegate: NSObject { + var buttonAction: BarButtonAction? + @objc func callActionBlock(_ sender: BarButtonItem) { buttonAction?(sender) } } @@ -22,7 +22,7 @@ public typealias BarButtonAction = (BarButtonItem) -> () //-------------------------------------------------- open weak var buttonDelegate: ButtonDelegateProtocol? - open var actionDelegate: ActionDelegate? + var actionDelegate: ActionDelegate? //-------------------------------------------------- // MARK: - Methods From 136b2d3f39e783acc43143489fc5480fbd8aecb8 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Fri, 12 Jun 2020 15:38:08 +0530 Subject: [PATCH 20/80] Initial commit - List_LeftVariable_NumberedList_BodyText --- MVMCoreUI.xcodeproj/project.pbxproj | 8 ++ MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 + ...ListLeftVariableNumberedListBodyText.swift | 90 +++++++++++++++++++ ...eftVariableNumberedListBodyTextModel.swift | 58 ++++++++++++ 4 files changed, 157 insertions(+) create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyTextModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 3af65c10..114dd245 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -116,6 +116,8 @@ 27F9736A246750BE00CAB5C5 /* ScreenBrightnessModifierBehavior.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27F97369246750BE00CAB5C5 /* ScreenBrightnessModifierBehavior.swift */; }; 31BE15CB23D8924D00452370 /* CheckboxLabelModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BE15C923D8924C00452370 /* CheckboxLabelModel.swift */; }; 31BE15CC23D8924D00452370 /* CheckboxModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31BE15CA23D8924C00452370 /* CheckboxModel.swift */; }; + 324FB6AA249366F3002552C7 /* ListLeftVariableNumberedListBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324FB6A9249366F3002552C7 /* ListLeftVariableNumberedListBodyTextModel.swift */; }; + 324FB6AC24936717002552C7 /* ListLeftVariableNumberedListBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324FB6AB24936717002552C7 /* ListLeftVariableNumberedListBodyText.swift */; }; 32F8804624765C6E00C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32F8804524765C6E00C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinksModel.swift */; }; 32F8804824765C8400C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32F8804724765C8400C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinks.swift */; }; 522679C123FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522679BF23FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift */; }; @@ -561,6 +563,8 @@ 27F97369246750BE00CAB5C5 /* ScreenBrightnessModifierBehavior.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScreenBrightnessModifierBehavior.swift; sourceTree = ""; }; 31BE15C923D8924C00452370 /* CheckboxLabelModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckboxLabelModel.swift; sourceTree = ""; }; 31BE15CA23D8924C00452370 /* CheckboxModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckboxModel.swift; sourceTree = ""; }; + 324FB6A9249366F3002552C7 /* ListLeftVariableNumberedListBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableNumberedListBodyTextModel.swift; sourceTree = ""; }; + 324FB6AB24936717002552C7 /* ListLeftVariableNumberedListBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableNumberedListBodyText.swift; sourceTree = ""; }; 32F8804524765C6E00C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinksModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableNumberedListAllTextAndLinksModel.swift; sourceTree = ""; }; 32F8804724765C8400C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableNumberedListAllTextAndLinks.swift; sourceTree = ""; }; 522679BF23FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinks.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListLeftVariableCheckboxAllTextAndLinks.swift; sourceTree = ""; }; @@ -1354,6 +1358,8 @@ AA997251247530B100FC7472 /* ListLeftVariableIconAllTextLinks.swift */, 32F8804524765C6E00C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinksModel.swift */, 32F8804724765C8400C2ACB3 /* ListLeftVariableNumberedListAllTextAndLinks.swift */, + 324FB6A9249366F3002552C7 /* ListLeftVariableNumberedListBodyTextModel.swift */, + 324FB6AB24936717002552C7 /* ListLeftVariableNumberedListBodyText.swift */, ); path = LeftVariable; sourceTree = ""; @@ -2053,6 +2059,7 @@ files = ( 0A775F2624893916009EFB58 /* ThreeHeadlineBodyLink.swift in Sources */, AAC6F167243332E400F295C1 /* RadioSwatchesModel.swift in Sources */, + 324FB6AA249366F3002552C7 /* ListLeftVariableNumberedListBodyTextModel.swift in Sources */, 5248BFED23F12E350059236A /* ListThreeColumnPlanDataDividerModel.swift in Sources */, AA0A257824766C8A00862F64 /* ListLeftVariableIconWithRightCaretBodyTextModel.swift in Sources */, 0A5D59C223AD2F5700EFD9E9 /* AppleGuidelinesProtocol.swift in Sources */, @@ -2309,6 +2316,7 @@ BB6C6AC0242232DF005F7224 /* ListOneColumnTextWithWhitespaceDividerTallModel.swift in Sources */, 8DEFA95E243DAC2F000D27E5 /* ListThreeColumnDataUsageDivider.swift in Sources */, D2A638FD22CA98280052ED1F /* HeadlineBody.swift in Sources */, + 324FB6AC24936717002552C7 /* ListLeftVariableNumberedListBodyText.swift in Sources */, AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */, 522679C223FE886900906CBA /* ListLeftVariableCheckboxAllTextAndLinksModel.swift in Sources */, AA7F32AB246C0F7900C965BA /* ListLeftVariableRadioButtonAllTextAndLinksModel.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index 98b1e6a3..508181cc 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -172,6 +172,7 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: ListLeftVariableCheckboxBodyText.self, viewModelClass: ListLeftVariableCheckboxBodyTextModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListLeftVariableIconAllTextLinks.self, viewModelClass: ListLeftVariableIconAllTextLinksModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListLeftVariableNumberedListAllTextAndLinks.self, viewModelClass: ListLeftVariableNumberedListAllTextAndLinksModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: ListLeftVariableNumberedListBodyText.self, viewModelClass: ListLeftVariableNumberedListBodyTextModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListRVWheel.self, viewModelClass: ListRVWheelModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListRightVariablePayments.self, viewModelClass: ListRightVariablePaymentsModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListRightVariableTotalData.self, viewModelClass: ListRightVariableTotalDataModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift new file mode 100644 index 00000000..c63b3e1a --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift @@ -0,0 +1,90 @@ +// +// ListLeftVariableNumberedListBodyText.swift +// MVMCoreUI +// +// Created by Subhankar Acharya on 12/06/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class ListLeftVariableNumberedListBodyText: TableViewCell { + //-------------------------------------------------- + // MARK: - Outlets + //----------------------------------------------------- + public let leftLabel = Label(fontStyle: .Title2XLarge) + public let headlineBody = HeadlineBody() + public var stack: Stack + + //-------------------------------------------------- + // MARK: - Initializers + //-------------------------------------------------- + + public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 10, horizontalAlignment: .fill)), + (view: headlineBody, model: StackItemModel(percent: 90, horizontalAlignment: .fill))], + axis: .horizontal) + super.init(style: style, reuseIdentifier: reuseIdentifier) + } + + public required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + //-------------------------------------------------- + // MARK: - Life Cycle + //-------------------------------------------------- + override open func setupView() { + super.setupView() + leftLabel.setContentHuggingPriority(.defaultHigh, for: .horizontal) + addMolecule(stack) + stack.restack() + updateAccessibilityLabel() + } + + //--------------------------------------------------- + // MARK: - Molecule + //--------------------------------------------------- + + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { + super.set(with: model, delegateObject, additionalData) + + guard let model = model as? ListLeftVariableNumberedListBodyTextModel else { return } + leftLabel.text = String(model.number) + headlineBody.set(with: model.headlineBody, delegateObject, additionalData) + updateAccessibilityLabel() + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 140 + } + + open override func reset() { + super.reset() + leftLabel.setFontStyle(.Title2XLarge) + } + + //-------------------------------------------------- + // MARK: - Accessibility + //-------------------------------------------------- + + func updateAccessibilityLabel() { + + var message = "" + + if let leftLabel = leftLabel.text { + message += leftLabel + ", " + } + + if let headlineLabel = headlineBody.headlineLabel.text { + message += headlineLabel + ", " + } + + if let messageLabel = headlineBody.messageLabel.text { + message += messageLabel + } + + accessibilityLabel = message + } +} + diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyTextModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyTextModel.swift new file mode 100644 index 00000000..372bab32 --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyTextModel.swift @@ -0,0 +1,58 @@ +// +// ListLeftVariableNumberedListBodyTextModel.swift +// MVMCoreUI +// +// Created by Subhankar Acharya on 12/06/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class ListLeftVariableNumberedListBodyTextModel: ListItemModel, MoleculeModelProtocol { + //----------------------------------------------------- + // MARK: - Properties + //----------------------------------------------------- + + public static var identifier: String = "listLVNLBdy" + public var number: Int + public var headlineBody: HeadlineBodyModel + + //----------------------------------------------------- + // MARK: - Initializer + //----------------------------------------------------- + + public init(number: Int, headlineBody: HeadlineBodyModel) { + self.number = number + self.headlineBody = headlineBody + super.init() + } + + //----------------------------------------------------- + // MARK: - Keys + //----------------------------------------------------- + + private enum CodingKeys: String, CodingKey { + case moleculeName + case number + case headlineBody + } + + //----------------------------------------------------- + // MARK: - Codec + //----------------------------------------------------- + + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + number = try typeContainer.decode(Int.self, forKey: .number) + headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody) + try super.init(from: decoder) + } + + public override func encode(to encoder: Encoder) throws { + try super.encode(to: encoder) + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encode(number, forKey: .number) + try container.encode(headlineBody, forKey: .headlineBody) + } +} From 17a14e0634cdf2475c2f657ddf60f01e35a49f7a Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 12 Jun 2020 14:43:01 -0400 Subject: [PATCH 21/80] Update accessibility for numberd left variable --- ...tVariableNumberedListAllTextAndLinks.swift | 59 ++++++------------- .../EyebrowHeadlineBodyLink.swift | 40 +++++++++++++ 2 files changed, 59 insertions(+), 40 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift index 5924b3d7..6b133172 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift @@ -40,7 +40,6 @@ import Foundation leftLabel.setContentHuggingPriority(.defaultHigh, for: .horizontal) addMolecule(stack) stack.restack() - updateAccessibilityLabel() } //--------------------------------------------------- @@ -76,56 +75,36 @@ import Foundation // MARK: - Accessibility //-------------------------------------------------- + func getAccessibilityMessage() -> String { + guard let leftLabel = leftLabel.text else { + return eyebrowHeadlineBodyLink.getAccessibilityMessage() + } + return leftLabel + ", " + eyebrowHeadlineBodyLink.getAccessibilityMessage() + } + func updateAccessibilityLabel() { - - var message = "" - - if let leftLabel = leftLabel.text { - message += leftLabel + ", " - } - - if let eyebrowLabel = eyebrowHeadlineBodyLink.eyebrow.text { - message += eyebrowLabel + ", " - } - - if let headlineLabel = eyebrowHeadlineBodyLink.headline.text { - message += headlineLabel + ", " - } - - if let bodyLabel = eyebrowHeadlineBodyLink.body.text { - message += bodyLabel - } - + let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 isAccessibilityElement = !linkShowing + accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none eyebrowHeadlineBodyLink.link.isAccessibilityElement = linkShowing - if !linkShowing { // Make whole cell focusable if no link. - accessibilityLabel = message + accessibilityLabel = getAccessibilityMessage() + accessibilityElements = nil + } else if let accessoryView = accessoryView { + // Both caret and link. Read all content on caret. + accessoryView.accessibilityLabel = getAccessibilityMessage() + accessibilityElements = [accessoryView, eyebrowHeadlineBodyLink.link] } else { - var elements: [UIView] = [] - + // Only link. Manually add accessibility elements to ensure they are read in the right order. + var elements: [Any] = [] if let leftLabelText = leftLabel.text, !leftLabelText.isEmpty { elements.append(leftLabel) } - - if let eyeBrowText = eyebrowHeadlineBodyLink.eyebrow.text, !eyeBrowText.isEmpty { - elements.append(eyebrowHeadlineBodyLink.eyebrow) + if let otherElements = eyebrowHeadlineBodyLink.getAccessibilityElements() { + elements.append(otherElements) } - - if let headlineText = eyebrowHeadlineBodyLink.headline.text, !headlineText.isEmpty { - elements.append(eyebrowHeadlineBodyLink.headline) - } - - if let bodyText = eyebrowHeadlineBodyLink.body.text, !bodyText.isEmpty { - elements.append(eyebrowHeadlineBodyLink.body) - } - - if linkShowing { - elements.append(eyebrowHeadlineBodyLink.link) - } - accessibilityElements = elements } } diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift index 7d176ba2..8a4d6d38 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift @@ -69,4 +69,44 @@ import UIKit open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { return 65 } + + //-------------------------------------------------- + // MARK: - Accessibility Helpers + //-------------------------------------------------- + + /// Returns the labels text in one message. + func getAccessibilityMessage() -> String { + var message = "" + + if let eyebrowLabel = eyebrow.text { + message += eyebrowLabel + ", " + } + + if let headlineLabel = headline.text { + message += headlineLabel + ", " + } + + if let bodyLabel = body.text { + message += bodyLabel + } + return message + } + + /// Returns an array of the appropriate accessibility elements. + func getAccessibilityElements() -> [Any]? { + var elements: [UIView] = [] + if eyebrow.hasText { + elements.append(eyebrow) + } + if headline.hasText { + elements.append(headline) + } + if body.hasText { + elements.append(body) + } + if link.titleLabel?.text?.count ?? 0 > 0 { + elements.append(link) + } + return elements.count > 0 ? elements : nil + } } From 061e9e6bd9f0eaa75f24e853a7d8e4a77cd2b572 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 12 Jun 2020 15:13:53 -0400 Subject: [PATCH 22/80] left variable accessibility clean --- ...tLeftVariableCheckboxAllTextAndLinks.swift | 28 ++------- .../ListLeftVariableCheckboxBodyText.swift | 2 +- .../ListLeftVariableIconAllTextLinks.swift | 60 +++++++------------ .../ListLeftVariableIconWithRightCaret.swift | 5 +- ...ftVariableIconWithRightCaretBodyText.swift | 5 +- ...tVariableNumberedListAllTextAndLinks.swift | 7 ++- ...ftVariableRadioButtonAllTextAndLinks.swift | 25 +------- ...tVariableRadioButtonAndPaymentMethod.swift | 24 +------- .../EyebrowHeadlineBodyLink.swift | 4 +- 9 files changed, 44 insertions(+), 116 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift index ff1c6e1b..9c8976f6 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift @@ -53,7 +53,7 @@ import Foundation checkbox.isAccessibilityElement = false accessibilityTraits = checkbox.accessibilityTraits accessibilityHint = checkbox.accessibilityHint - // Update accessibility label on radio button state change. + // Update accessibility label on checkbox state change. observation = observe(\.checkbox.isSelected, options: [.new]) { [weak self] _, _ in self?.updateAccessibilityLabel() } @@ -92,16 +92,8 @@ import Foundation message += checkboxLabel + ", " } - if let eyebrowLabel = eyebrowHeadlineBodyLink.eyebrow.text, !eyebrowLabel.isEmpty { - message += eyebrowLabel + ", " - } - - if let headlineLabel = eyebrowHeadlineBodyLink.headline.text, !headlineLabel.isEmpty { - message += headlineLabel + ", " - } - - if let bodyLabel = eyebrowHeadlineBodyLink.body.text, !bodyLabel.isEmpty { - message += bodyLabel + if let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() { + message += label } let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 @@ -114,19 +106,9 @@ import Foundation // Make whole cell focusable if no link. accessibilityLabel = message } else { - // Allow only radio button and link to be focused on. + // Allow only checkbox and link to be focused on. checkbox.accessibilityLabel = message - var elements: [UIView] = [] - - if message.count > 0 { - elements.append(checkbox) - } - - if linkShowing { - elements.append(eyebrowHeadlineBodyLink.link) - } - - accessibilityElements = elements + accessibilityElements = [checkbox, eyebrowHeadlineBodyLink.link] } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxBodyText.swift index 326c9320..1d83cbfb 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxBodyText.swift @@ -52,7 +52,7 @@ import Foundation checkbox.isAccessibilityElement = false accessibilityTraits = checkbox.accessibilityTraits accessibilityHint = checkbox.accessibilityHint - // Update accessibility label on radio button state change. + // Update accessibility label on checkbox state change. observation = observe(\.checkbox.isSelected, options: [.new]) { [weak self] _, _ in self?.updateAccessibilityLabel() } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift index 1f8a6a43..9e4d7533 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift @@ -42,7 +42,6 @@ import Foundation leftImage.imageView.contentMode = .scaleAspectFit addMolecule(stack) stack.restack() - updateAccessibilityLabel() } //-------------------------------------------------- @@ -63,57 +62,40 @@ import Foundation return 140 } + func getAccessibilityMessage() -> String? { + guard let leftImageLabel = leftImage.accessibilityLabel else { + return eyebrowHeadlineBodyLink.getAccessibilityMessage() + } + guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else { + return leftImageLabel + } + return leftImageLabel + ", " + label + } + func updateAccessibilityLabel() { - var message = "" - - if let leftImageLabel = leftImage.accessibilityLabel { - message += leftImageLabel + ", " - } - - if let eyebrowLabel = eyebrowHeadlineBodyLink.eyebrow.text { - message += eyebrowLabel + ", " - } - - if let headlineLabel = eyebrowHeadlineBodyLink.headline.text { - message += headlineLabel + ", " - } - - if let bodyLabel = eyebrowHeadlineBodyLink.body.text { - message += bodyLabel - } - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 isAccessibilityElement = !linkShowing + accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none eyebrowHeadlineBodyLink.link.isAccessibilityElement = linkShowing if !linkShowing { // Make whole cell focusable if no link. - accessibilityLabel = message + accessibilityLabel = getAccessibilityMessage() + accessibilityElements = nil + } else if let accessoryView = accessoryView { + // Both caret and link. Read all content on caret. + accessoryView.accessibilityLabel = getAccessibilityMessage() + accessibilityElements = [accessoryView, eyebrowHeadlineBodyLink.link] } else { - // Allow only radio button and link to be focused on. - var elements: [UIView] = [] - + // Only link. Manually add accessibility elements to ensure they are read in the right order. + var elements: [Any] = [] if let leftImageLabel = leftImage.accessibilityLabel, !leftImageLabel.isEmpty { elements.append(leftImage) } - - if let eyeBrowText = eyebrowHeadlineBodyLink.eyebrow.text, !eyeBrowText.isEmpty { - elements.append(eyebrowHeadlineBodyLink.eyebrow) + if let otherElements = eyebrowHeadlineBodyLink.getAccessibilityElements() { + elements.append(otherElements) } - - if let headlineText = eyebrowHeadlineBodyLink.headline.text, !headlineText.isEmpty { - elements.append(eyebrowHeadlineBodyLink.headline) - } - - if let bodyText = eyebrowHeadlineBodyLink.body.text, !bodyText.isEmpty { - elements.append(eyebrowHeadlineBodyLink.body) - } - - if linkShowing { - elements.append(eyebrowHeadlineBodyLink.link) - } - accessibilityElements = elements } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaret.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaret.swift index 297ef31b..821becbe 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaret.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaret.swift @@ -48,8 +48,6 @@ import UIKit rightLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 902), for: .horizontal) addMolecule(stack) stack.restack() - isAccessibilityElement = true - updateAccessibilityLabel() } //-------------------------------------------------- @@ -78,7 +76,7 @@ import UIKit } func updateAccessibilityLabel() { - + isAccessibilityElement = true var message = "" if let leftImageLabel = leftImage.accessibilityLabel { @@ -94,5 +92,6 @@ import UIKit } accessibilityLabel = message + accessibilityTraits = (accessoryView != nil) ? .button : .none } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyText.swift index 0617b5e8..c416e536 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyText.swift @@ -58,10 +58,8 @@ import Foundation rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal) rightLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 900), for: .horizontal) rightLabel.numberOfLines = 1 - isAccessibilityElement = true addMolecule(stack) stack.restack() - updateAccessibilityLabel() } //-------------------------------------------------- @@ -93,7 +91,7 @@ import Foundation //-------------------------------------------------- func updateAccessibilityLabel() { - + isAccessibilityElement = true var message = "" if let leftImageLabel = leftImage.accessibilityLabel { @@ -113,5 +111,6 @@ import Foundation } accessibilityLabel = message + accessibilityTraits = (accessoryView != nil) ? .button : .none } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift index 6b133172..183514de 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift @@ -75,11 +75,14 @@ import Foundation // MARK: - Accessibility //-------------------------------------------------- - func getAccessibilityMessage() -> String { + func getAccessibilityMessage() -> String? { guard let leftLabel = leftLabel.text else { return eyebrowHeadlineBodyLink.getAccessibilityMessage() } - return leftLabel + ", " + eyebrowHeadlineBodyLink.getAccessibilityMessage() + guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else { + return leftLabel + } + return leftLabel + ", " + label } func updateAccessibilityLabel() { diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAllTextAndLinks.swift index 5756d4f5..229a2456 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAllTextAndLinks.swift @@ -89,16 +89,8 @@ import Foundation message += radioButtonLabel + ", " } - if let eyebrowLabel = eyebrowHeadlineBodyLink.eyebrow.text { - message += eyebrowLabel + ", " - } - - if let headlineLabel = eyebrowHeadlineBodyLink.headline.text { - message += headlineLabel + ", " - } - - if let bodyLabel = eyebrowHeadlineBodyLink.body.text { - message += bodyLabel + if let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() { + message += label } let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 @@ -112,18 +104,7 @@ import Foundation } else { // Allow only radio button and link to be focused on. radioButton.accessibilityLabel = message - - var elements: [UIView] = [] - - if !message.isEmpty { - elements.append(radioButton) - } - - if linkShowing { - elements.append(eyebrowHeadlineBodyLink.link) - } - - accessibilityElements = elements + accessibilityElements = [radioButton, eyebrowHeadlineBodyLink.link] } } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift index 523c6d4e..6cc26352 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift @@ -107,16 +107,8 @@ import UIKit message += leftImageLabel + ", " } - if let eyebrowLabel = eyebrowHeadlineBodyLink.eyebrow.text { - message += eyebrowLabel + ", " - } - - if let headlineLabel = eyebrowHeadlineBodyLink.headline.text { - message += headlineLabel + ", " - } - - if let bodyLabel = eyebrowHeadlineBodyLink.body.text { - message += bodyLabel + if let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() { + message += label } let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 @@ -130,17 +122,7 @@ import UIKit } else { // Allow only radio button and link to be focused on. radioButton.accessibilityLabel = message - var elements: [UIView] = [] - - if !message.isEmpty { - elements.append(radioButton) - } - - if linkShowing { - elements.append(eyebrowHeadlineBodyLink.link) - } - - accessibilityElements = elements + accessibilityElements = [radioButton, eyebrowHeadlineBodyLink.link] } } } diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift index 8a4d6d38..12b42e9f 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/EyebrowHeadlineBodyLink.swift @@ -75,7 +75,7 @@ import UIKit //-------------------------------------------------- /// Returns the labels text in one message. - func getAccessibilityMessage() -> String { + func getAccessibilityMessage() -> String? { var message = "" if let eyebrowLabel = eyebrow.text { @@ -89,7 +89,7 @@ import UIKit if let bodyLabel = body.text { message += bodyLabel } - return message + return message.count > 0 ? message : nil } /// Returns an array of the appropriate accessibility elements. From 843616f75570b34002f944f9b0d0f7c458171b83 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 12 Jun 2020 15:53:18 -0400 Subject: [PATCH 23/80] right variable changes --- .../List/ListProgressBarThin.swift | 5 +- .../List/RightVariable/ListRVWheel.swift | 5 +- ...stRightVariableButtonAllTextAndLinks.swift | 59 ++++++++--------- .../ListRightVariablePayments.swift | 5 +- ...htVariablePriceChangeAllTextAndLinks.swift | 61 +++++++----------- ...ListRightVariablePriceChangeBodyText.swift | 5 +- ...RightVariableTextLinkAllTextAndLinks.swift | 63 ++++++++----------- .../ListRightVariableTotalData.swift | 5 +- 8 files changed, 83 insertions(+), 125 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListProgressBarThin.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListProgressBarThin.swift index 08255db9..4e0eb83a 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListProgressBarThin.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListProgressBarThin.swift @@ -78,8 +78,6 @@ import Foundation stack.restack() horizontalStack.restack() labelStack.restack() - isAccessibilityElement = true - updateAccessibilityLabel() } //------------------------------------------------------ @@ -115,7 +113,7 @@ import Foundation //------------------------------------------------------ func updateAccessibilityLabel() { - + isAccessibilityElement = true var message = "" if let leftHeadlineText = leftHeadline.text { @@ -135,5 +133,6 @@ import Foundation } accessibilityLabel = message + accessibilityTraits = (accessoryView != nil) ? .button : .none } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRVWheel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRVWheel.swift index f410c635..58b9ada0 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRVWheel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRVWheel.swift @@ -41,8 +41,6 @@ import Foundation rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal) addMolecule(stack) stack.restack() - isAccessibilityElement = true - updateAccessibilityLabel() } //------------------------------------------------- @@ -75,7 +73,7 @@ import Foundation //-------------------------------------------------- func updateAccessibilityLabel() { - + isAccessibilityElement = true var message = "" if let leftLabelText = leftLabel.text, !leftLabelText.isEmpty { @@ -91,5 +89,6 @@ import Foundation } accessibilityLabel = message + accessibilityTraits = (accessoryView != nil) ? .button : .none } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift index 6e9503dc..c08d37cd 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift @@ -47,9 +47,9 @@ import Foundation addMolecule(stack) stack.restack() - updateAccessibilityLabel() accessibilityValue = button.accessibilityValue accessibilityHint = button.accessibilityHint + accessibilityTraits = .button } //----------------------------------------------------- @@ -74,48 +74,39 @@ import Foundation // MARK: - Accessibility //---------------------------------------------------- + func getAccessibilityMessage() -> String? { + guard let buttonText = button.titleLabel?.text else { + return eyebrowHeadlineBodyLink.getAccessibilityMessage() + } + guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else { + return buttonText + } + return label + ", " + buttonText + } + func updateAccessibilityLabel() { - - var message = "" - - if let eyebrowLabel = eyebrowHeadlineBodyLink.eyebrow.text { - message += eyebrowLabel + ", " - } - - if let headlineLabel = eyebrowHeadlineBodyLink.headline.text { - message += headlineLabel + ", " - } - - if let bodyLabel = eyebrowHeadlineBodyLink.body.text { - message += bodyLabel + ", " - } - - if let buttonLabel = button.accessibilityLabel { - message += buttonLabel - } - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 - isAccessibilityElement = !linkShowing - button.isAccessibilityElement = linkShowing eyebrowHeadlineBodyLink.link.isAccessibilityElement = linkShowing - - if !linkShowing { - // Make whole cell focusable if no link. - accessibilityLabel = message + button.isAccessibilityElement = linkShowing + + if !linkShowing && accessoryView == nil { + // Make whole cell focusable if one action + accessibilityLabel = getAccessibilityMessage() + accessibilityElements = nil } else { - // Allow only radio button and link to be focused on. - button.accessibilityLabel = message - var elements: [UIView] = [] - - if !message.isEmpty { - elements.append(button) + // Make buttons focusable. + var elements: [Any] = [] + if let accessoryView = accessoryView { + accessoryView.accessibilityLabel = eyebrowHeadlineBodyLink.getAccessibilityMessage() + elements.append(accessoryView) + } else { + button.accessibilityLabel = getAccessibilityMessage() } - if linkShowing { elements.append(eyebrowHeadlineBodyLink.link) } - + elements.append(link) accessibilityElements = elements } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePayments.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePayments.swift index 5bb62b90..2b12a4c2 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePayments.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePayments.swift @@ -40,8 +40,6 @@ import Foundation rightImage.addSizeConstraintsForAspectRatio = true addMolecule(stack) stack.restack() - isAccessibilityElement = true - updateAccessibilityLabel() } //---------------------------------------------------- @@ -72,7 +70,7 @@ import Foundation //-------------------------------------------------- func updateAccessibilityLabel() { - + isAccessibilityElement = true var message = "" if let leftLabelText = leftLabel.text, !leftLabelText.isEmpty { @@ -84,5 +82,6 @@ import Foundation } accessibilityLabel = message + accessibilityTraits = (accessoryView != nil) ? .button : .none } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift index afbdd2b5..76ce1a37 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift @@ -67,7 +67,6 @@ import Foundation arrow.pinHeightAndWidth() addMolecule(stack) stack.restack() - updateAccessibilityLabel() } open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { @@ -89,57 +88,39 @@ import Foundation // MARK: - Accessibility //-------------------------------------------------- + func getAccessibilityMessage() -> String? { + guard let rightLabelText = rightLabel.text else { + return eyebrowHeadlineBodyLink.getAccessibilityMessage() + } + guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else { + return rightLabelText + } + return label + ", " + rightLabelText + } + func updateAccessibilityLabel() { - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 isAccessibilityElement = !linkShowing + accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none eyebrowHeadlineBodyLink.link.isAccessibilityElement = linkShowing if !linkShowing { // Make whole cell focusable if no link. - var message = "" - - if let eyebrowLabel = eyebrowHeadlineBodyLink.eyebrow.text { - message += eyebrowLabel + ", " - } - - if let headlineLabel = eyebrowHeadlineBodyLink.headline.text { - message += headlineLabel + ", " - } - - if let bodyLabel = eyebrowHeadlineBodyLink.body.text { - message += bodyLabel + ", " - } - - if let rightLabelText = rightLabel.text { - message += rightLabelText - } - - accessibilityLabel = message - + accessibilityLabel = getAccessibilityMessage() + accessibilityElements = nil + } else if let accessoryView = accessoryView { + // Both caret and link. Read all content on caret. + accessoryView.accessibilityLabel = getAccessibilityMessage() + accessibilityElements = [accessoryView, eyebrowHeadlineBodyLink.link] } else { - var elements: [UIView] = [] - - if let eyebrowText = eyebrowHeadlineBodyLink.eyebrow.text, !eyebrowText.isEmpty { - elements.append(eyebrowHeadlineBodyLink.eyebrow) + // Only link. Manually add accessibility elements to ensure they are read in the right order. + var elements: [Any] = [] + if let otherElements = eyebrowHeadlineBodyLink.getAccessibilityElements() { + elements.append(otherElements) } - - if let headlineText = eyebrowHeadlineBodyLink.headline.text, !headlineText.isEmpty { - elements.append(eyebrowHeadlineBodyLink.headline) - } - - if let bodyText = eyebrowHeadlineBodyLink.body.text, !bodyText.isEmpty { - elements.append(eyebrowHeadlineBodyLink.body) - } - - if linkShowing { - elements.append(eyebrowHeadlineBodyLink.link) - } - if let rightLabelText = rightLabel.text, !rightLabelText.isEmpty { elements.append(rightLabel) } - accessibilityElements = elements } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeBodyText.swift index a93d50f9..8428dccc 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeBodyText.swift @@ -54,8 +54,6 @@ import Foundation addMolecule(stack) stack.restack() arrowAndRightLabelStack.restack() - isAccessibilityElement = true - updateAccessibilityLabel() } //-------------------------------------------------- @@ -87,7 +85,7 @@ import Foundation //-------------------------------------------------- func updateAccessibilityLabel() { - + isAccessibilityElement = true var message = "" if let headlineText = headlineBody.headlineLabel.text, !headlineText.isEmpty { @@ -103,5 +101,6 @@ import Foundation } accessibilityLabel = message + accessibilityTraits = (accessoryView != nil) ? .button : .none } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift index 2dd2ca99..d6714f60 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift @@ -47,7 +47,6 @@ import Foundation addMolecule(stack) stack.restack() - updateAccessibilityLabel() } //-------------------------------------------------- @@ -72,52 +71,44 @@ import Foundation // MARK: - Accessibility //-------------------------------------------------- + func getAccessibilityMessage() -> String? { + guard let linkText = link.titleLabel?.text else { + return eyebrowHeadlineBodyLink.getAccessibilityMessage() + } + guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else { + return linkText + } + return label + ", " + linkText + } + func updateAccessibilityLabel() { - - var message = "" - - if let eyebrowLabel = eyebrowHeadlineBodyLink.eyebrow.text { - message += eyebrowLabel + ", " - } - - if let headlineLabel = eyebrowHeadlineBodyLink.headline.text { - message += headlineLabel + ", " - } - - if let bodyLabel = eyebrowHeadlineBodyLink.body.text { - message += bodyLabel + ", " - } - - if let linkLabel = link.accessibilityLabel { - message += linkLabel - } - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 - isAccessibilityElement = !linkShowing - link.isAccessibilityElement = linkShowing + accessibilityTraits = .button eyebrowHeadlineBodyLink.link.isAccessibilityElement = linkShowing - - if !linkShowing { - // Make whole cell focusable if no link. - accessibilityLabel = message + link.isAccessibilityElement = linkShowing + + if !linkShowing && accessoryView == nil { + // Make whole cell focusable if one action + accessibilityLabel = getAccessibilityMessage() + accessibilityElements = nil } else { - // Allow only radio button and link to be focused on. - link.accessibilityLabel = message - var elements: [UIView] = [] - + // Make buttons focusable. + var elements: [Any] = [] + if let accessoryView = accessoryView { + accessoryView.accessibilityLabel = eyebrowHeadlineBodyLink.getAccessibilityMessage() + elements.append(accessoryView) + } else { + link.accessibilityLabel = getAccessibilityMessage() + } if linkShowing { elements.append(eyebrowHeadlineBodyLink.link) } - - if !message.isEmpty { - elements.append(link) - } - + elements.append(link) accessibilityElements = elements } } - + open override func accessibilityActivate() -> Bool { return link.accessibilityActivate() } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift index a42cd81d..fe2c8a24 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift @@ -51,8 +51,6 @@ import Foundation rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal) addMolecule(stack) stack.restack() - isAccessibilityElement = true - updateAccessibilityLabel() } //-------------------------------------------------- @@ -86,7 +84,7 @@ import Foundation //-------------------------------------------------- func updateAccessibilityLabel() { - + isAccessibilityElement = true var message = "" if let leftLabelText = leftLabel.text, !leftLabelText.isEmpty { @@ -98,5 +96,6 @@ import Foundation } accessibilityLabel = message + accessibilityTraits = (accessoryView != nil) ? .button : .none } } From cdbdb907717c71c99a519092e9f3f642028e5ee5 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 12 Jun 2020 16:22:12 -0400 Subject: [PATCH 24/80] accessibility columns --- .../ListDeviceComplexButtonMedium.swift | 29 ++++++++++++++----- .../Device/ListDeviceComplexButtonSmall.swift | 29 ++++++++++++++----- .../ListFourColumnDataUsageListItem.swift | 4 +-- ...neColumnFullWidthTextAllTextAndLinks.swift | 29 ++++++++++--------- .../ListOneColumnFullWidthTextBodyText.swift | 4 +-- .../ListThreeColumnDataUsage.swift | 4 +-- .../ListThreeColumnInternationalData.swift | 4 +-- .../ListTwoColumnCompareChanges.swift | 1 - .../ListTwoColumnPriceDescription.swift | 5 +--- .../TwoColumn/ListTwoColumnPriceDetails.swift | 4 +-- 10 files changed, 65 insertions(+), 48 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift index 983cfc59..0783ea99 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift @@ -58,10 +58,8 @@ import Foundation addMolecule(stack) stack.restack() verticalStack.restack() - isAccessibilityElement = true accessibilityTraits = button.accessibilityTraits accessibilityHint = button.accessibilityHint - updateAccessibilityLabel() } //-------------------------------------------------- @@ -100,10 +98,8 @@ import Foundation // MARK: - Accessibility //-------------------------------------------------- - func updateAccessibilityLabel() { - + func getAccessibilityMessage() -> String? { var message = "" - if let eyebrowText = eyebrow.text, !eyebrowText.isEmpty { message += eyebrowText + ", " } @@ -123,8 +119,27 @@ import Foundation if let rightImageViewText = rightImageView.accessibilityLabel, !rightImageViewText.isEmpty { message += rightImageViewText } - - accessibilityLabel = message + return message.count > 0 ? message : nil + } + + func updateAccessibilityLabel() { + accessibilityTraits = .button + if let accessoryView = accessoryView { + // Both caret and button. Read all content on caret. + isAccessibilityElement = false + accessoryView.accessibilityLabel = getAccessibilityMessage() + accessibilityElements = [accessoryView, button] + } else { + // Make whole cell focusable if no action. + isAccessibilityElement = true + accessibilityElements = nil + if let message = getAccessibilityMessage(), + let buttonTitle = button.titleLabel?.text { + accessibilityLabel = message + ", " + buttonTitle + } else { + accessibilityLabel = getAccessibilityMessage() + } + } } open override func accessibilityActivate() -> Bool { diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift index f0ee4619..20433a45 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift @@ -58,10 +58,8 @@ import Foundation addMolecule(stack) stack.restack() verticalStack.restack() - isAccessibilityElement = true accessibilityTraits = button.accessibilityTraits accessibilityHint = button.accessibilityHint - updateAccessibilityLabel() } //-------------------------------------------------- @@ -100,10 +98,8 @@ import Foundation // MARK: - Accessibility //-------------------------------------------------- - func updateAccessibilityLabel() { - + func getAccessibilityMessage() -> String? { var message = "" - if let eyebrowText = eyebrow.text, !eyebrowText.isEmpty { message += eyebrowText + ", " } @@ -123,8 +119,27 @@ import Foundation if let rightImageViewText = rightImageView.accessibilityLabel, !rightImageViewText.isEmpty { message += rightImageViewText } - - accessibilityLabel = message + return message.count > 0 ? message : nil + } + + func updateAccessibilityLabel() { + accessibilityTraits = .button + if let accessoryView = accessoryView { + // Both caret and button. Read all content on caret. + isAccessibilityElement = false + accessoryView.accessibilityLabel = getAccessibilityMessage() + accessibilityElements = [accessoryView, button] + } else { + // Make whole cell focusable if no action. + isAccessibilityElement = true + accessibilityElements = nil + if let message = getAccessibilityMessage(), + let buttonTitle = button.titleLabel?.text { + accessibilityLabel = message + ", " + buttonTitle + } else { + accessibilityLabel = getAccessibilityMessage() + } + } } open override func accessibilityActivate() -> Bool { diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/FourColumn/ListFourColumnDataUsageListItem.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/FourColumn/ListFourColumnDataUsageListItem.swift index 4ae4c4d2..8455a5bf 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/FourColumn/ListFourColumnDataUsageListItem.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/FourColumn/ListFourColumnDataUsageListItem.swift @@ -54,8 +54,6 @@ import Foundation arrow.pinHeightAndWidth() arrowAndLabel2Stack.restack() stack.restack() - isAccessibilityElement = true - updateAccessibilityLabel() } //----------------------------------------------------- @@ -92,7 +90,7 @@ import Foundation //----------------------------------------------------- func updateAccessibilityLabel() { - + isAccessibilityElement = true var message = "" if let label1Text = label1.text, !label1Text.isEmpty { diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift index a5d2a374..ee97a369 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift @@ -43,7 +43,6 @@ import Foundation super.setupView() addMolecule(stack) stack.restack() - updateAccessibilityLabel() } open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { @@ -72,8 +71,7 @@ import Foundation // MARK: - Accessibility //-------------------------------------------------- - func updateAccessibilityLabel() { - + func getAccessibilityMessage() -> String? { var message = "" if let eyebrowLabel = eyebrow.text, !eyebrowLabel.isEmpty { @@ -91,19 +89,26 @@ import Foundation if let bodyLabel = body.text, !bodyLabel.isEmpty { message += bodyLabel } - + return message.count > 0 ? message : nil + } + + func updateAccessibilityLabel() { + let linkShowing = link.titleLabel?.text?.count ?? 0 > 0 isAccessibilityElement = !linkShowing link.isAccessibilityElement = linkShowing if !linkShowing { // Make whole cell focusable if no link. - accessibilityLabel = message + accessibilityLabel = getAccessibilityMessage() + accessibilityElements = nil + } else if let accessoryView = accessoryView { + // Both caret and link. Read all content on caret. + accessoryView.accessibilityLabel = getAccessibilityMessage() + accessibilityElements = [accessoryView, link] } else { - // Allow only radio button and link to be focused on. - var elements: [UIView] = [] - - + // Only link. Manually add accessibility elements to ensure they are read in the right order. + var elements: [Any] = [] if let eyeBrowText = eyebrow.text, !eyeBrowText.isEmpty { elements.append(eyebrow) } @@ -119,11 +124,7 @@ import Foundation if let bodyText = body.text, !bodyText.isEmpty { elements.append(body) } - - if linkShowing { - elements.append(link) - } - + elements.append(link) accessibilityElements = elements } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextBodyText.swift index bad9caca..cced55dd 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextBodyText.swift @@ -24,8 +24,6 @@ import Foundation super.setupView() addMolecule(headlineBody) - isAccessibilityElement = true - updateAccessibilityLabel() } open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?){ @@ -46,7 +44,7 @@ import Foundation //----------------------------------------------------- func updateAccessibilityLabel() { - + isAccessibilityElement = true var message = "" if let headlineLabel = headlineBody.headlineLabel.text { diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnDataUsage.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnDataUsage.swift index 00a09527..6e0013d1 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnDataUsage.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnDataUsage.swift @@ -42,8 +42,6 @@ import Foundation super.setupView() addMolecule(stack) stack.restack() - isAccessibilityElement = true - updateAccessibilityLabel() } //-------------------------------------------------- @@ -77,7 +75,7 @@ import Foundation //-------------------------------------------------- func updateAccessibilityLabel() { - + isAccessibilityElement = true var message = "" if let leftText = leftLabel.text, !leftText.isEmpty { diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift index 20e7378a..c8aaef83 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnInternationalData.swift @@ -55,8 +55,6 @@ import Foundation arrow.pinHeightAndWidth() arrowAndLabel2Stack.restack() stack.restack() - isAccessibilityElement = true - updateAccessibilityLabel() } open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { @@ -87,7 +85,7 @@ import Foundation //-------------------------------------------------- func updateAccessibilityLabel() { - + isAccessibilityElement = true var message = "" if let leftText = leftLabel.text, !leftText.isEmpty { diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnCompareChanges.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnCompareChanges.swift index e0efa546..62048a71 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnCompareChanges.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnCompareChanges.swift @@ -54,7 +54,6 @@ import Foundation ((molecule as? StackItem)?.view as? Stack)?.restack() } containingStack.restack() - isAccessibilityElement = false } //------------------------------------------------------ diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDescription.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDescription.swift index 16328584..472c522d 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDescription.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDescription.swift @@ -67,9 +67,6 @@ import Foundation leftHeadline.numberOfLines = 1 rightLabel.numberOfLines = 1 rightSubLabel.numberOfLines = 1 - - isAccessibilityElement = true - updateAccessibilityLabel() } //---------------------------------------------------- @@ -107,7 +104,7 @@ import Foundation //---------------------------------------------------- func updateAccessibilityLabel() { - + isAccessibilityElement = true var message = "" if let leftHeadline = leftHeadline.text, !leftHeadline.isEmpty { diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDetails.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDetails.swift index e725bb64..cc59a15a 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDetails.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/TwoColumn/ListTwoColumnPriceDetails.swift @@ -31,8 +31,6 @@ import UIKit containerHelper.constrainView(view) rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal) rightLabel.setContentHuggingPriority(.defaultHigh, for: .vertical) - isAccessibilityElement = true - updateAccessibilityLabel() } open override func updateView(_ size: CGFloat) { @@ -72,7 +70,7 @@ import UIKit //---------------------------------------------------- func updateAccessibilityLabel() { - + isAccessibilityElement = true var message = "" if let leftLabel = leftLabel.text, !leftLabel.isEmpty { From 023576d260ff3dc9bda2cb0eb44f151f4e01444c Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 12 Jun 2020 16:32:50 -0400 Subject: [PATCH 25/80] remove unnecessary setters --- .../List/Device/ListDeviceComplexButtonMedium.swift | 1 - .../List/Device/ListDeviceComplexButtonSmall.swift | 1 - .../LeftVariable/ListLeftVariableIconAllTextLinks.swift | 1 - .../ListOneColumnFullWidthTextAllTextAndLinks.swift | 1 - .../ListRightVariableButtonAllTextAndLinks.swift | 6 +++--- .../ListRightVariablePriceChangeAllTextAndLinks.swift | 1 - .../ListRightVariableTextLinkAllTextAndLinks.swift | 4 ++-- 7 files changed, 5 insertions(+), 10 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift index 0783ea99..5ce18f6e 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift @@ -132,7 +132,6 @@ import Foundation } else { // Make whole cell focusable if no action. isAccessibilityElement = true - accessibilityElements = nil if let message = getAccessibilityMessage(), let buttonTitle = button.titleLabel?.text { accessibilityLabel = message + ", " + buttonTitle diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift index 20433a45..25ae3714 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift @@ -132,7 +132,6 @@ import Foundation } else { // Make whole cell focusable if no action. isAccessibilityElement = true - accessibilityElements = nil if let message = getAccessibilityMessage(), let buttonTitle = button.titleLabel?.text { accessibilityLabel = message + ", " + buttonTitle diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift index 9e4d7533..2411a339 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift @@ -82,7 +82,6 @@ import Foundation if !linkShowing { // Make whole cell focusable if no link. accessibilityLabel = getAccessibilityMessage() - accessibilityElements = nil } else if let accessoryView = accessoryView { // Both caret and link. Read all content on caret. accessoryView.accessibilityLabel = getAccessibilityMessage() diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift index ee97a369..979f8110 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift @@ -101,7 +101,6 @@ import Foundation if !linkShowing { // Make whole cell focusable if no link. accessibilityLabel = getAccessibilityMessage() - accessibilityElements = nil } else if let accessoryView = accessoryView { // Both caret and link. Read all content on caret. accessoryView.accessibilityLabel = getAccessibilityMessage() diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift index c08d37cd..f7042b56 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift @@ -86,16 +86,16 @@ import Foundation func updateAccessibilityLabel() { let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 - isAccessibilityElement = !linkShowing eyebrowHeadlineBodyLink.link.isAccessibilityElement = linkShowing button.isAccessibilityElement = linkShowing if !linkShowing && accessoryView == nil { // Make whole cell focusable if one action + isAccessibilityElement = true accessibilityLabel = getAccessibilityMessage() - accessibilityElements = nil } else { // Make buttons focusable. + isAccessibilityElement = false var elements: [Any] = [] if let accessoryView = accessoryView { accessoryView.accessibilityLabel = eyebrowHeadlineBodyLink.getAccessibilityMessage() @@ -106,7 +106,7 @@ import Foundation if linkShowing { elements.append(eyebrowHeadlineBodyLink.link) } - elements.append(link) + elements.append(button) accessibilityElements = elements } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift index 76ce1a37..4f4180a0 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift @@ -107,7 +107,6 @@ import Foundation if !linkShowing { // Make whole cell focusable if no link. accessibilityLabel = getAccessibilityMessage() - accessibilityElements = nil } else if let accessoryView = accessoryView { // Both caret and link. Read all content on caret. accessoryView.accessibilityLabel = getAccessibilityMessage() diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift index d6714f60..7a4c4595 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift @@ -83,17 +83,17 @@ import Foundation func updateAccessibilityLabel() { let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 - isAccessibilityElement = !linkShowing accessibilityTraits = .button eyebrowHeadlineBodyLink.link.isAccessibilityElement = linkShowing link.isAccessibilityElement = linkShowing if !linkShowing && accessoryView == nil { // Make whole cell focusable if one action + isAccessibilityElement = true accessibilityLabel = getAccessibilityMessage() - accessibilityElements = nil } else { // Make buttons focusable. + isAccessibilityElement = false var elements: [Any] = [] if let accessoryView = accessoryView { accessoryView.accessibilityLabel = eyebrowHeadlineBodyLink.getAccessibilityMessage() From 799d6555c07058872b95d585168878fc9f8c1164 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 12 Jun 2020 16:34:18 -0400 Subject: [PATCH 26/80] remove duplicate code device list --- .../List/Device/ListDeviceComplexButtonSmall.swift | 1 - .../ListLeftVariableNumberedListAllTextAndLinks.swift | 1 - 2 files changed, 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift index 25ae3714..2503cf8a 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift @@ -123,7 +123,6 @@ import Foundation } func updateAccessibilityLabel() { - accessibilityTraits = .button if let accessoryView = accessoryView { // Both caret and button. Read all content on caret. isAccessibilityElement = false diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift index 183514de..e0819e4e 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift @@ -94,7 +94,6 @@ import Foundation if !linkShowing { // Make whole cell focusable if no link. accessibilityLabel = getAccessibilityMessage() - accessibilityElements = nil } else if let accessoryView = accessoryView { // Both caret and link. Read all content on caret. accessoryView.accessibilityLabel = getAccessibilityMessage() From 00a71036f3e3954356e43e004e49b5aa5cf7c7c9 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 12 Jun 2020 16:35:28 -0400 Subject: [PATCH 27/80] remove duplicate --- .../List/Device/ListDeviceComplexButtonMedium.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift index 5ce18f6e..cca10f8f 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift @@ -123,7 +123,6 @@ import Foundation } func updateAccessibilityLabel() { - accessibilityTraits = .button if let accessoryView = accessoryView { // Both caret and button. Read all content on caret. isAccessibilityElement = false From 9498053dce49f8cccdd6e7dfb65ae4c77da70bcc Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 12 Jun 2020 16:52:51 -0400 Subject: [PATCH 28/80] remove unneeded code --- .../ListLeftVariableCheckboxAllTextAndLinks.swift | 6 ------ .../LeftVariable/ListLeftVariableCheckboxBodyText.swift | 1 - .../LeftVariable/ListLeftVariableIconAllTextLinks.swift | 4 +--- .../ListLeftVariableNumberedListAllTextAndLinks.swift | 1 - .../ListLeftVariableRadioButtonAllTextAndLinks.swift | 3 --- .../ListLeftVariableRadioButtonAndPaymentMethod.swift | 3 --- .../LeftVariable/ListLeftVariableRadioButtonBodyText.swift | 1 - .../ListRightVariableButtonAllTextAndLinks.swift | 3 --- .../ListRightVariableTextLinkAllTextAndLinks.swift | 3 --- 9 files changed, 1 insertion(+), 24 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift index 9c8976f6..65d1bd63 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift @@ -49,8 +49,6 @@ import Foundation addMolecule(stack) stack.restack() - isAccessibilityElement = true - checkbox.isAccessibilityElement = false accessibilityTraits = checkbox.accessibilityTraits accessibilityHint = checkbox.accessibilityHint // Update accessibility label on checkbox state change. @@ -97,11 +95,7 @@ import Foundation } let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 - isAccessibilityElement = !linkShowing - checkbox.isAccessibilityElement = linkShowing - eyebrowHeadlineBodyLink.link.isAccessibilityElement = linkShowing - if !linkShowing { // Make whole cell focusable if no link. accessibilityLabel = message diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxBodyText.swift index 1d83cbfb..9d58b625 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxBodyText.swift @@ -49,7 +49,6 @@ import Foundation addMolecule(stack) stack.restack() isAccessibilityElement = true - checkbox.isAccessibilityElement = false accessibilityTraits = checkbox.accessibilityTraits accessibilityHint = checkbox.accessibilityHint // Update accessibility label on checkbox state change. diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift index 2411a339..15ec2c22 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift @@ -76,9 +76,7 @@ import Foundation let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 isAccessibilityElement = !linkShowing - accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none - eyebrowHeadlineBodyLink.link.isAccessibilityElement = linkShowing - + accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none if !linkShowing { // Make whole cell focusable if no link. accessibilityLabel = getAccessibilityMessage() diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift index e0819e4e..1da91ee3 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift @@ -90,7 +90,6 @@ import Foundation let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 isAccessibilityElement = !linkShowing accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none - eyebrowHeadlineBodyLink.link.isAccessibilityElement = linkShowing if !linkShowing { // Make whole cell focusable if no link. accessibilityLabel = getAccessibilityMessage() diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAllTextAndLinks.swift index 229a2456..e5e9e178 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAllTextAndLinks.swift @@ -95,9 +95,6 @@ import Foundation let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 isAccessibilityElement = !linkShowing - radioButton.isAccessibilityElement = linkShowing - eyebrowHeadlineBodyLink.link.isAccessibilityElement = linkShowing - if !linkShowing { // Make whole cell focusable if no link. accessibilityLabel = message diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift index 6cc26352..e8a2ed3c 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift @@ -113,9 +113,6 @@ import UIKit let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 isAccessibilityElement = !linkShowing - radioButton.isAccessibilityElement = linkShowing - eyebrowHeadlineBodyLink.link.isAccessibilityElement = linkShowing - if !linkShowing { // Make whole cell focusable if no link. accessibilityLabel = message diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyText.swift index 860b78f8..c6349aa1 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyText.swift @@ -47,7 +47,6 @@ open class ListLeftVariableRadioButtonBodyText: TableViewCell { // Make the whole cell focusable. isAccessibilityElement = true - radioButton.isAccessibilityElement = false accessibilityTraits = radioButton.accessibilityTraits accessibilityHint = radioButton.accessibilityHint updateAccessibilityLabel() diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift index f7042b56..9c590b0c 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift @@ -86,9 +86,6 @@ import Foundation func updateAccessibilityLabel() { let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 - eyebrowHeadlineBodyLink.link.isAccessibilityElement = linkShowing - button.isAccessibilityElement = linkShowing - if !linkShowing && accessoryView == nil { // Make whole cell focusable if one action isAccessibilityElement = true diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift index 7a4c4595..215eb9f0 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift @@ -84,9 +84,6 @@ import Foundation func updateAccessibilityLabel() { let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 accessibilityTraits = .button - eyebrowHeadlineBodyLink.link.isAccessibilityElement = linkShowing - link.isAccessibilityElement = linkShowing - if !linkShowing && accessoryView == nil { // Make whole cell focusable if one action isAccessibilityElement = true From 36505156d570644c83f2ff0d9fd3ed1b7eca2376 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 12 Jun 2020 17:36:13 -0400 Subject: [PATCH 29/80] image accessibility fix --- .../List/Device/ListDeviceComplexButtonMedium.swift | 2 +- .../List/Device/ListDeviceComplexButtonSmall.swift | 2 +- .../List/Device/ListDeviceComplexLinkMedium.swift | 6 +++--- .../List/Device/ListDeviceComplexLinkSmall.swift | 6 +++--- .../LeftVariable/ListLeftVariableIconAllTextLinks.swift | 4 ++-- .../ListLeftVariableIconWithRightCaretBodyText.swift | 2 +- .../ListLeftVariableRadioButtonAndPaymentMethod.swift | 2 +- .../ListOneColumnFullWidthTextAllTextAndLinks.swift | 4 +--- .../List/RightVariable/ListRightVariablePayments.swift | 2 +- .../ListRightVariablePriceChangeAllTextAndLinks.swift | 4 +--- 10 files changed, 15 insertions(+), 19 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift index cca10f8f..d8885875 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift @@ -116,7 +116,7 @@ import Foundation message += body2Text + ", " } - if let rightImageViewText = rightImageView.accessibilityLabel, !rightImageViewText.isEmpty { + if let rightImageViewText = rightImageView.imageView.accessibilityLabel, !rightImageViewText.isEmpty { message += rightImageViewText } return message.count > 0 ? message : nil diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift index 2503cf8a..b2e4b25c 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift @@ -116,7 +116,7 @@ import Foundation message += body2Text + ", " } - if let rightImageViewText = rightImageView.accessibilityLabel, !rightImageViewText.isEmpty { + if let rightImageViewText = rightImageView.imageView.accessibilityLabel, !rightImageViewText.isEmpty { message += rightImageViewText } return message.count > 0 ? message : nil diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexLinkMedium.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexLinkMedium.swift index 9c75f78c..ee6ade09 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexLinkMedium.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexLinkMedium.swift @@ -114,7 +114,7 @@ import Foundation message += body2Text + ", " } - if let rightImageLabel = rightImage.accessibilityLabel, !rightImageLabel.isEmpty { + if let rightImageLabel = rightImage.imageView.accessibilityLabel, !rightImageLabel.isEmpty { message += rightImageLabel } @@ -145,8 +145,8 @@ import Foundation views.append(twoLinkView.leftLink) views.append(twoLinkView.rightLink) - if let rightImageLabel = rightImage.accessibilityLabel, !rightImageLabel.isEmpty { - views.append(rightImage) + if let rightImageLabel = rightImage.imageView.accessibilityLabel, !rightImageLabel.isEmpty { + views.append(rightImage.imageView) } accessibilityElements = views diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexLinkSmall.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexLinkSmall.swift index 6a469b0d..1791ec9d 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexLinkSmall.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexLinkSmall.swift @@ -111,7 +111,7 @@ import Foundation message += body2Text + ", " } - if let rightImageLabel = rightImage.accessibilityLabel, !rightImageLabel.isEmpty { + if let rightImageLabel = rightImage.imageView.accessibilityLabel, !rightImageLabel.isEmpty { message += rightImageLabel } @@ -142,8 +142,8 @@ import Foundation views.append(twoLinkView.leftLink) views.append(twoLinkView.rightLink) - if let rightImageLabel = rightImage.accessibilityLabel, !rightImageLabel.isEmpty { - views.append(rightImage) + if let rightImageLabel = rightImage.imageView.accessibilityLabel, !rightImageLabel.isEmpty { + views.append(rightImage.imageView) } accessibilityElements = views diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift index 15ec2c22..7396aefa 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift @@ -87,8 +87,8 @@ import Foundation } else { // Only link. Manually add accessibility elements to ensure they are read in the right order. var elements: [Any] = [] - if let leftImageLabel = leftImage.accessibilityLabel, !leftImageLabel.isEmpty { - elements.append(leftImage) + if let leftImageLabel = leftImage.imageView.accessibilityLabel, !leftImageLabel.isEmpty { + elements.append(leftImage.imageView) } if let otherElements = eyebrowHeadlineBodyLink.getAccessibilityElements() { elements.append(otherElements) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyText.swift index c416e536..c69bebb2 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyText.swift @@ -94,7 +94,7 @@ import Foundation isAccessibilityElement = true var message = "" - if let leftImageLabel = leftImage.accessibilityLabel { + if let leftImageLabel = leftImage.imageView.accessibilityLabel { message += leftImageLabel + ", " } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift index e8a2ed3c..9d036d4f 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift @@ -103,7 +103,7 @@ import UIKit message += radioButtonLabel + ", " } - if let leftImageLabel = leftImage.accessibilityLabel { + if let leftImageLabel = leftImage.imageView.accessibilityLabel { message += leftImageLabel + ", " } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift index 979f8110..a355dd4c 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift @@ -95,9 +95,7 @@ import Foundation func updateAccessibilityLabel() { let linkShowing = link.titleLabel?.text?.count ?? 0 > 0 - isAccessibilityElement = !linkShowing - link.isAccessibilityElement = linkShowing - + isAccessibilityElement = !linkShowing if !linkShowing { // Make whole cell focusable if no link. accessibilityLabel = getAccessibilityMessage() diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePayments.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePayments.swift index 2b12a4c2..f6526e10 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePayments.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePayments.swift @@ -77,7 +77,7 @@ import Foundation message += leftLabelText + ", " } - if let rightImageText = rightImage.accessibilityLabel, !rightImageText.isEmpty { + if let rightImageText = rightImage.imageView.accessibilityLabel, !rightImageText.isEmpty { message += rightImageText } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift index 4f4180a0..65301304 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift @@ -101,9 +101,7 @@ import Foundation func updateAccessibilityLabel() { let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 isAccessibilityElement = !linkShowing - accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none - eyebrowHeadlineBodyLink.link.isAccessibilityElement = linkShowing - + accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none if !linkShowing { // Make whole cell focusable if no link. accessibilityLabel = getAccessibilityMessage() From d5447e5842cafb8b041c4b5628a365754bf2ac6a Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 12 Jun 2020 17:37:35 -0400 Subject: [PATCH 30/80] missed image commit --- .../List/LeftVariable/ListLeftVariableIconAllTextLinks.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift index 7396aefa..9655c4dd 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift @@ -63,7 +63,7 @@ import Foundation } func getAccessibilityMessage() -> String? { - guard let leftImageLabel = leftImage.accessibilityLabel else { + guard let leftImageLabel = leftImage.imageView.accessibilityLabel else { return eyebrowHeadlineBodyLink.getAccessibilityMessage() } guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else { From 0e42a10c13dbbb74408c32ab52a9232535086231 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 12 Jun 2020 17:46:14 -0400 Subject: [PATCH 31/80] image fix --- .../List/LeftVariable/ListLeftVariableIconWithRightCaret.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaret.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaret.swift index 821becbe..2ebe1c98 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaret.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaret.swift @@ -79,7 +79,7 @@ import UIKit isAccessibilityElement = true var message = "" - if let leftImageLabel = leftImage.accessibilityLabel { + if let leftImageLabel = leftImage.imageView.accessibilityLabel { message += leftImageLabel + ", " } From 7f7edb1ab6ba211933a564c5acd8e2e1bbf28151 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 15 Jun 2020 11:12:02 -0400 Subject: [PATCH 32/80] change ordering --- .../RightVariable/ListRightVariableButtonAllTextAndLinks.swift | 2 +- .../ListRightVariableTextLinkAllTextAndLinks.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift index 9c590b0c..f0d5cdbf 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift @@ -100,10 +100,10 @@ import Foundation } else { button.accessibilityLabel = getAccessibilityMessage() } + elements.append(button) if linkShowing { elements.append(eyebrowHeadlineBodyLink.link) } - elements.append(button) accessibilityElements = elements } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift index 215eb9f0..2c2f25bc 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift @@ -98,10 +98,10 @@ import Foundation } else { link.accessibilityLabel = getAccessibilityMessage() } + elements.append(link) if linkShowing { elements.append(eyebrowHeadlineBodyLink.link) } - elements.append(link) accessibilityElements = elements } } From fbc631d151a9fee2cdacacedb587578e7b5cfbdb Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 15 Jun 2020 11:42:31 -0400 Subject: [PATCH 33/80] trait miss --- .../OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift index a355dd4c..184abebc 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift @@ -95,7 +95,8 @@ import Foundation func updateAccessibilityLabel() { let linkShowing = link.titleLabel?.text?.count ?? 0 > 0 - isAccessibilityElement = !linkShowing + isAccessibilityElement = !linkShowing + accessibilityTraits = (accessoryView != nil) ? .button : .none if !linkShowing { // Make whole cell focusable if no link. accessibilityLabel = getAccessibilityMessage() From 78ca4984f1081c70ce8ca34ee04ef730ef16a886 Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Tue, 16 Jun 2020 09:51:59 +0530 Subject: [PATCH 34/80] parsing analytics data --- .../Atomic/Molecules/Items/CarouselItemModel.swift | 5 +++++ MVMCoreUI/Atomic/Organisms/Carousel.swift | 12 ++++++++++++ .../ModelProtocols/CarouselItemModelProtocol.swift | 7 +++++++ 3 files changed, 24 insertions(+) diff --git a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift index 15a83552..9165cec7 100644 --- a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift +++ b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift @@ -10,6 +10,8 @@ import Foundation @objcMembers public class CarouselItemModel: MoleculeCollectionItemModel, CarouselItemModelProtocol { + public var analyticsData: [String : String]? + //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- @@ -28,6 +30,7 @@ import Foundation private enum CodingKeys: String, CodingKey { case peakingUI case peakingArrowColor + case analyticsData } //-------------------------------------------------- @@ -38,6 +41,7 @@ import Foundation let typeContainer = try decoder.container(keyedBy: CodingKeys.self) peakingUI = try typeContainer.decodeIfPresent(Bool.self, forKey: .peakingUI) peakingArrowColor = try typeContainer.decodeIfPresent(Color.self, forKey: .peakingArrowColor) + analyticsData = try typeContainer.decodeIfPresent([String:String].self, forKey: .analyticsData) try super.init(from: decoder) } @@ -46,5 +50,6 @@ import Foundation var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(peakingUI, forKey: .peakingUI) try container.encodeIfPresent(peakingArrowColor, forKey: .peakingArrowColor) + try container.encodeIfPresent(analyticsData, forKey: .analyticsData) } } diff --git a/MVMCoreUI/Atomic/Organisms/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel.swift index abc0e74b..baa62c88 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel.swift @@ -163,6 +163,9 @@ open class Carousel: View { pageIndex = carouselModel.index pagingView?.currentIndex = carouselModel.index collectionView.reloadData() + + // track analyticsData + trackSwipeActionAnalyticsforIndex(pageIndex) } //-------------------------------------------------- @@ -297,6 +300,13 @@ open class Carousel: View { cell.accessibilityElementsHidden = true } } + func trackSwipeActionAnalyticsforIndex(_ index : Int){ + guard let itemModel = molecules?[index], + let analyticsData = itemModel.analyticsData, + let viewcontrollerObject = delegateObject?.moleculeDelegate as? MVMCoreViewControllerProtocol else { return } + MVMCoreUILoggingHandler.shared()?.defaultLogAction(forController:viewcontrollerObject, actionInformation: analyticsData, additionalData: analyticsData) + + } } extension Carousel: UICollectionViewDelegateFlowLayout { @@ -454,5 +464,7 @@ extension Carousel: UIScrollViewDelegate { // Cycle to other end if on buffer cell. pagingView?.currentIndex = pageIndex showPeaking(true) + // track analyticsData + trackSwipeActionAnalyticsforIndex(pageIndex) } } diff --git a/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift b/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift index 198cf80d..2d8444b5 100644 --- a/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift @@ -10,4 +10,11 @@ import Foundation public protocol CarouselItemModelProtocol: ContainerModelProtocol { + var analyticsData: [String:String]? { get } +} +public extension CarouselItemModelProtocol { + + var analyticsData: [String:String]? { + get { return nil} + } } From 5502dd22f7f74503e7435af774e283be8026a2d3 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Tue, 16 Jun 2020 15:16:35 +0530 Subject: [PATCH 35/80] Changes for alignment issue in iPhone 11 simulator and accessibility updates --- .../ListLeftVariableNumberedListBodyText.swift | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift index c63b3e1a..572ede57 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift @@ -21,8 +21,9 @@ import Foundation //-------------------------------------------------- public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 10, horizontalAlignment: .fill)), - (view: headlineBody, model: StackItemModel(percent: 90, horizontalAlignment: .fill))], + + stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(horizontalAlignment: .fill)), + (view: headlineBody, model: StackItemModel(horizontalAlignment: .leading))], axis: .horizontal) super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -36,10 +37,10 @@ import Foundation //-------------------------------------------------- override open func setupView() { super.setupView() - leftLabel.setContentHuggingPriority(.defaultHigh, for: .horizontal) + leftLabel.setContentCompressionResistancePriority(.required, for: .horizontal) + leftLabel.setContentHuggingPriority(.defaultHigh, for: .vertical) addMolecule(stack) stack.restack() - updateAccessibilityLabel() } //--------------------------------------------------- @@ -70,6 +71,8 @@ import Foundation func updateAccessibilityLabel() { + isAccessibilityElement = true + var message = "" if let leftLabel = leftLabel.text { @@ -85,6 +88,7 @@ import Foundation } accessibilityLabel = message + accessibilityTraits = (accessoryView != nil) ? .button : .none } } From 0e0de7a0fa58e75fb1c1c1a5378d4959578bb19b Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Tue, 16 Jun 2020 16:26:29 +0530 Subject: [PATCH 36/80] adobe tracking method added --- MVMCoreUI/Atomic/Organisms/Carousel.swift | 6 ++++-- MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.h | 3 +++ MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.m | 4 ++++ MVMCoreUI/Utility/MVMCoreUIConstants.h | 4 ++++ MVMCoreUI/Utility/MVMCoreUIConstants.m | 4 ++++ 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Organisms/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel.swift index baa62c88..71f8c198 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel.swift @@ -302,9 +302,11 @@ open class Carousel: View { } func trackSwipeActionAnalyticsforIndex(_ index : Int){ guard let itemModel = molecules?[index], - let analyticsData = itemModel.analyticsData, + var analyticsData = itemModel.analyticsData, let viewcontrollerObject = delegateObject?.moleculeDelegate as? MVMCoreViewControllerProtocol else { return } - MVMCoreUILoggingHandler.shared()?.defaultLogAction(forController:viewcontrollerObject, actionInformation: analyticsData, additionalData: analyticsData) + analyticsData[KeyAdobeTrackerPageType] = viewcontrollerObject.loadObject??.pageType + analyticsData["ClassName"] = String(describing: type(of: viewcontrollerObject)) + MVMCoreUILoggingHandler.shared()?.trackAdobeAnalytics(analyticsData) } } diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.h b/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.h index 9fec90f5..869bb098 100644 --- a/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.h +++ b/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.h @@ -20,6 +20,9 @@ NS_ASSUME_NONNULL_BEGIN - (void)defaultLogActionForController:(nonnull id )controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData; - (nullable NSDictionary *)defaultGetActionTrackDataDictionaryForController:(nonnull id )controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData; +- (void)trackAdobeAnalytics:(nullable NSDictionary *)analyticsData; + + @end NS_ASSUME_NONNULL_END diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.m b/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.m index 0c694cce..4c99b1af 100644 --- a/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.m +++ b/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.m @@ -19,5 +19,9 @@ - (nullable NSDictionary *)defaultGetActionTrackDataDictionaryForController:(nonnull id )controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData { return nil; } +- (void)trackAnalyticsAction:(nullable NSDictionary *)analyticsData{ + +} + @end diff --git a/MVMCoreUI/Utility/MVMCoreUIConstants.h b/MVMCoreUI/Utility/MVMCoreUIConstants.h index 4c0a3553..c70f9e84 100644 --- a/MVMCoreUI/Utility/MVMCoreUIConstants.h +++ b/MVMCoreUI/Utility/MVMCoreUIConstants.h @@ -82,3 +82,7 @@ typedef NS_ENUM(NSInteger, CoreUIErrorCode) { #pragma mark - Apple Design Guidelines extern CGFloat const MinimumTappableArea; + +#pragma mark - Adobe Action Tracking + +extern NSString * const KeyAdobeTrackerPageType; diff --git a/MVMCoreUI/Utility/MVMCoreUIConstants.m b/MVMCoreUI/Utility/MVMCoreUIConstants.m index 5f5a9a45..34e3dc8c 100644 --- a/MVMCoreUI/Utility/MVMCoreUIConstants.m +++ b/MVMCoreUI/Utility/MVMCoreUIConstants.m @@ -74,3 +74,7 @@ NSString * const KeyHandScroll = @"hand_scroll"; #pragma mark - Apple Design Guidelines CGFloat const MinimumTappableArea = 44.0f; + +#pragma mark - Adobe Action Tracking + +NSString * const KeyAdobeTrackerPageType = @"vzwi.mvmapp.PageType"; From e4436b4e29d457079ca9ebb3eb8bd62a3292b861 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 16 Jun 2020 19:42:16 +0530 Subject: [PATCH 37/80] 19223(iOS - Headers - H2 - Pricing - Two Rows) initial commit. Added model and molecule class files. --- MVMCoreUI.xcodeproj/project.pbxproj | 8 ++ MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 + .../Headers/HeadersH2PricingTwoRows.swift | 95 +++++++++++++++++++ .../HeadersH2PricingTwoRowsModel.swift | 90 ++++++++++++++++++ 4 files changed, 194 insertions(+) create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRows.swift create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRowsModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 3af65c10..9e306fad 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -201,6 +201,8 @@ AA56A211243C5EFC00303286 /* ListTwoColumnSubsectionDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA56A210243C5EFC00303286 /* ListTwoColumnSubsectionDivider.swift */; }; AA617AB02453010A00910B8F /* ListDeviceComplexLinkSmall.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA617AAF2453010A00910B8F /* ListDeviceComplexLinkSmall.swift */; }; AA617AB22453012400910B8F /* ListDeviceComplexLinkSmallModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA617AB12453012400910B8F /* ListDeviceComplexLinkSmallModel.swift */; }; + AA633B3124989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA633B3024989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift */; }; + AA633B3324989ED500731E80 /* HeadersH2PricingTwoRows.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA633B3224989ED500731E80 /* HeadersH2PricingTwoRows.swift */; }; AA69AAF62445BF5700AF3D3B /* ListLeftVariableCheckboxBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA69AAF52445BF5700AF3D3B /* ListLeftVariableCheckboxBodyText.swift */; }; AA69AAF82445BF6800AF3D3B /* ListLeftVariableCheckboxBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA69AAF72445BF6800AF3D3B /* ListLeftVariableCheckboxBodyTextModel.swift */; }; AA7F32AB246C0F7900C965BA /* ListLeftVariableRadioButtonAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA7F32AA246C0F7900C965BA /* ListLeftVariableRadioButtonAllTextAndLinksModel.swift */; }; @@ -646,6 +648,8 @@ AA56A210243C5EFC00303286 /* ListTwoColumnSubsectionDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnSubsectionDivider.swift; sourceTree = ""; }; AA617AAF2453010A00910B8F /* ListDeviceComplexLinkSmall.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListDeviceComplexLinkSmall.swift; sourceTree = ""; }; AA617AB12453012400910B8F /* ListDeviceComplexLinkSmallModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListDeviceComplexLinkSmallModel.swift; sourceTree = ""; }; + AA633B3024989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2PricingTwoRowsModel.swift; sourceTree = ""; }; + AA633B3224989ED500731E80 /* HeadersH2PricingTwoRows.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2PricingTwoRows.swift; sourceTree = ""; }; AA69AAF52445BF5700AF3D3B /* ListLeftVariableCheckboxBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableCheckboxBodyText.swift; sourceTree = ""; }; AA69AAF72445BF6800AF3D3B /* ListLeftVariableCheckboxBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableCheckboxBodyTextModel.swift; sourceTree = ""; }; AA7F32AA246C0F7900C965BA /* ListLeftVariableRadioButtonAllTextAndLinksModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableRadioButtonAllTextAndLinksModel.swift; sourceTree = ""; }; @@ -1038,6 +1042,8 @@ AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */, AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */, AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */, + AA633B3024989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift */, + AA633B3224989ED500731E80 /* HeadersH2PricingTwoRows.swift */, ); path = Headers; sourceTree = ""; @@ -2217,6 +2223,7 @@ 0ABD136D237CAD1E0081388D /* DateDropdownEntryField.swift in Sources */, D264FA8E243BCD9A00D98315 /* CollectionTemplate.swift in Sources */, 0A7EF85B23D8A52800B2AAD1 /* EntryFieldModel.swift in Sources */, + AA633B3124989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift in Sources */, 8DEFA95C243DAC20000D27E5 /* ListThreeColumnDataUsageDividerModel.swift in Sources */, D2092357244FA1EF0044AD09 /* ThreeLayerModelBase.swift in Sources */, 0A1B4A96233BB18F005B3FB4 /* CheckboxLabel.swift in Sources */, @@ -2433,6 +2440,7 @@ 0A25209824645B76000FA9F6 /* TextViewEntryFieldModel.swift in Sources */, 525019DD2406430800EED91C /* ListProgressBarDataModel.swift in Sources */, C6FA7D5223C77A4A00A3614A /* UnOrderedList.swift in Sources */, + AA633B3324989ED500731E80 /* HeadersH2PricingTwoRows.swift in Sources */, 01509D8F2327EC6F00EF99AA /* MoleculeTableViewCell.swift in Sources */, 0A6682A22434DB4F00AD3CA1 /* ListLeftVariableRadioButtonBodyText.swift in Sources */, EA5124FD243601600051A3A4 /* BGImageHeadlineBodyButton.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index 98b1e6a3..2c5f54e6 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -206,6 +206,7 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2TinyButton.self, viewModelClass: HeadersH2TinyButtonModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2Buttons.self, viewModelClass: HeadersH2ButtonsModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2PricingTwoRows.self, viewModelClass: HeadersH2PricingTwoRowsModel.self) // Device Items MoleculeObjectMapping.shared()?.register(viewClass: ListDeviceComplexButtonMedium.self, viewModelClass: ListDeviceComplexButtonMediumModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRows.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRows.swift new file mode 100644 index 00000000..9d861fe2 --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRows.swift @@ -0,0 +1,95 @@ +// +// HeadersH2PricingTwoRows.swift +// MVMCoreUI +// +// Created by Lekshmi S on 16/06/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class HeadersH2PricingTwoRows: HeaderView { + //-------------------------------------------------- + // MARK: - Outlets + //-------------------------------------------------- + public let headline = Label(fontStyle: .H2) + public let body = Label(fontStyle: .B2) + public let subBody = Label(fontStyle: .B3) + public let body2 = Label(fontStyle: .B2) + public let subBody2 = Label(fontStyle: .B3) + public let body3 = Label(fontStyle: .B2) + public let subBody3 = Label(fontStyle: .B3) + public let verticalLine1 = Line() + public let verticalLine2 = Line() + public let verticalStack1: Stack + public let verticalStack2: Stack + public let verticalStack3: Stack + public let horizontalStack: Stack + public let stack: Stack + + //------------------------------------------------------- + // MARK: - Initializers + //------------------------------------------------------- + public override init(frame: CGRect) { + verticalStack1 = Stack.createStack(with: [body, subBody], spacing: 0) + verticalStack2 = Stack.createStack(with: [body2, subBody2], spacing: 0) + verticalStack3 = Stack.createStack(with: [body3, subBody3], spacing: 0) + horizontalStack = Stack.createStack(with: [(view: verticalStack1, model: StackItemModel(percent: 29, horizontalAlignment: .leading, verticalAlignment: .top)), (view: verticalLine1, model: StackItemModel(percent: 2, verticalAlignment: .top)), + (view: verticalStack2, model: StackItemModel(percent: 33, horizontalAlignment: .center, verticalAlignment: .top)), + (view: verticalLine2, model: StackItemModel(percent: 2, verticalAlignment: .top)), + (view: verticalStack3, model: StackItemModel(percent: 34, horizontalAlignment: .center, verticalAlignment: .top))], + axis: .horizontal) + stack = Stack.createStack(with: [headline, horizontalStack], spacing: 8) + super.init(frame: frame) + } + + public required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + //------------------------------------------------------- + // MARK: - Lifecycle + //------------------------------------------------------- + open override func setupView() { + super.setupView() + verticalLine1.widthConstraint?.isActive = true + verticalLine1.backgroundColor = .mvmBlack + verticalLine1.heightConstraint?.constant = 13 + verticalLine2.widthConstraint?.isActive = true + verticalLine2.backgroundColor = .mvmBlack + verticalLine2.heightConstraint?.constant = 13 + addMolecule(stack) + stack.restack() + verticalStack1.restack() + verticalStack2.restack() + verticalStack3.restack() + horizontalStack.restack() + } + + //---------------------------------------------------- + // MARK: - Molecule + //------------------------------------------------------ + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { + super.set(with: model, delegateObject, additionalData) + guard let model = model as? HeadersH2PricingTwoRowsModel else { return } + headline.set(with: model.headline, delegateObject, additionalData) + verticalStack1.updateContainedMolecules(with: [model.body, model.subBody], delegateObject, additionalData) + verticalStack2.updateContainedMolecules(with: [model.body2, model.subBody2], delegateObject, additionalData) + verticalStack3.updateContainedMolecules(with: [model.body3, model.subBody3], delegateObject, additionalData) + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 121 + } + + open override func reset() { + super.reset() + headline.setFontStyle(.H2) + body.setFontStyle(.B2) + subBody.setFontStyle(.B3) + body2.setFontStyle(.B2) + subBody2.setFontStyle(.B3) + body3.setFontStyle(.B2) + subBody3.setFontStyle(.B3) + } +} diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRowsModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRowsModel.swift new file mode 100644 index 00000000..6991bf03 --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRowsModel.swift @@ -0,0 +1,90 @@ +// +// HeadersH2PricingTwoRowsModel.swift +// MVMCoreUI +// +// Created by Lekshmi S on 16/06/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class HeadersH2PricingTwoRowsModel: HeaderModel, MoleculeModelProtocol { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + public static var identifier: String = "headerH2TwoRows" + public var headline: LabelModel + public var body: LabelModel + public var subBody: LabelModel? + public var body2: LabelModel + public var subBody2: LabelModel? + public var body3: LabelModel + public var subBody3: LabelModel? + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public init(headline: LabelModel, body: LabelModel, subBody: LabelModel? = nil, body2: LabelModel, subBody2: LabelModel? = nil, body3: LabelModel, subBody3: LabelModel? = nil) { + self.headline = headline + self.body = body + self.subBody = subBody + self.body2 = body2 + self.subBody2 = subBody2 + self.body3 = body3 + self.subBody3 = subBody3 + super.init() + } + + //-------------------------------------------------- + // MARK: - Methods + //-------------------------------------------------- + public override func setDefaults() { + super.setDefaults() + body.hero = 0 + subBody?.attributes = [LabelAttributeStrikeThroughModel(0, subBody?.text.count ?? 0)] + subBody2?.attributes = [LabelAttributeStrikeThroughModel(0, subBody2?.text.count ?? 0)] + subBody3?.attributes = [LabelAttributeStrikeThroughModel(0, subBody3?.text.count ?? 0)] + } + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + private enum CodingKeys: String, CodingKey { + case moleculeName + case headline + case body + case subBody + case body2 + case subBody2 + case body3 + case subBody3 + } + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + headline = try typeContainer.decode(LabelModel.self, forKey: .headline) + body = try typeContainer.decode(LabelModel.self, forKey: .body) + subBody = try typeContainer.decode(LabelModel.self, forKey: .subBody) + body2 = try typeContainer.decode(LabelModel.self, forKey: .body2) + subBody2 = try typeContainer.decode(LabelModel.self, forKey: .subBody2) + body3 = try typeContainer.decode(LabelModel.self, forKey: .body3) + subBody3 = try typeContainer.decode(LabelModel.self, forKey: .subBody3) + try super.init(from: decoder) + } + + public override func encode(to encoder: Encoder) throws { + try super.encode(to: encoder) + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encode(headline, forKey: .headline) + try container.encode(body, forKey: .body) + try container.encode(subBody, forKey: .subBody) + try container.encode(body2, forKey: .body2) + try container.encode(subBody2, forKey: .subBody2) + try container.encode(body3, forKey: .body3) + try container.encode(subBody3, forKey: .subBody3) + } +} From 9d1e1f4f4ba284628d8442a81ce6f0df001f6624 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Tue, 16 Jun 2020 20:16:52 +0530 Subject: [PATCH 38/80] Added horizontal hugging priority --- .../List/LeftVariable/ListLeftVariableNumberedListBodyText.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift index 572ede57..a0a7a462 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift @@ -39,6 +39,7 @@ import Foundation super.setupView() leftLabel.setContentCompressionResistancePriority(.required, for: .horizontal) leftLabel.setContentHuggingPriority(.defaultHigh, for: .vertical) + leftLabel.setContentHuggingPriority(.defaultHigh, for: .horizontal) addMolecule(stack) stack.restack() } From 8200fe07d26b195b040429e3253c2caa7b406c36 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 16 Jun 2020 11:02:31 -0400 Subject: [PATCH 39/80] swap trait and hint due to apple defect --- MVMCoreUI/Atomic/Atoms/Selectors/Checkbox.swift | 2 +- MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift | 2 +- .../Views/CarouselIndicator/BarsIndicatorView.swift | 2 +- MVMCoreUI/Atomic/Atoms/Views/Toggle.swift | 4 ++-- .../List/Device/ListDeviceComplexButtonMedium.swift | 2 +- .../List/Device/ListDeviceComplexButtonSmall.swift | 2 +- .../ListLeftVariableCheckboxAllTextAndLinks.swift | 2 +- .../LeftVariable/ListLeftVariableCheckboxBodyText.swift | 2 +- .../ListLeftVariableRadioButtonAndPaymentMethod.swift | 4 ++-- .../ListLeftVariableRadioButtonBodyText.swift | 2 +- .../ListOneColumnFullWidthTextAllTextAndLinks.swift | 9 ++++++++- .../VerticalCombinationViews/ThreeHeadlineBodyLink.swift | 2 +- MVMCoreUI/BaseClasses/TableViewCell.swift | 2 +- 13 files changed, 22 insertions(+), 15 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/Checkbox.swift b/MVMCoreUI/Atomic/Atoms/Selectors/Checkbox.swift index cffbb916..f23fd337 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/Checkbox.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/Checkbox.swift @@ -157,9 +157,9 @@ import MVMCore override public init(frame: CGRect) { super.init(frame: frame) - accessibilityTraits = .button isAccessibilityElement = true accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "checkbox_action_hint") + accessibilityTraits = .button updateAccessibilityLabel() } diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift index 43750513..371d3f7a 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift @@ -147,8 +147,8 @@ import UIKit addTarget(self, action: #selector(tapAction), for: .touchUpInside) isAccessibilityElement = true - accessibilityTraits = .button accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "radio_action_hint") + accessibilityTraits = .button updateAccessibilityLabel() } diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift index 9dc4a0bd..69048e74 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift @@ -115,12 +115,12 @@ open class BarsIndicatorView: CarouselIndicator { for i in 0.. (Bool) super.setupView() isAccessibilityElement = true - accessibilityTraits = .button accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "AccToggleHint") accessibilityLabel = MVMCoreUIUtility.hardcodedString(withKey: "Toggle_buttonlabel") - + accessibilityTraits = .button + heightConstraint = heightAnchor.constraint(equalToConstant: Self.containerSize.height) heightConstraint?.isActive = true diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift index d8885875..986ee73b 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift @@ -58,8 +58,8 @@ import Foundation addMolecule(stack) stack.restack() verticalStack.restack() - accessibilityTraits = button.accessibilityTraits accessibilityHint = button.accessibilityHint + accessibilityTraits = button.accessibilityTraits } //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift index b2e4b25c..cd43215b 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift @@ -58,8 +58,8 @@ import Foundation addMolecule(stack) stack.restack() verticalStack.restack() - accessibilityTraits = button.accessibilityTraits accessibilityHint = button.accessibilityHint + accessibilityTraits = button.accessibilityTraits } //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift index 65d1bd63..ff625e8b 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift @@ -49,8 +49,8 @@ import Foundation addMolecule(stack) stack.restack() - accessibilityTraits = checkbox.accessibilityTraits accessibilityHint = checkbox.accessibilityHint + accessibilityTraits = checkbox.accessibilityTraits // Update accessibility label on checkbox state change. observation = observe(\.checkbox.isSelected, options: [.new]) { [weak self] _, _ in self?.updateAccessibilityLabel() diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxBodyText.swift index 9d58b625..69ad2156 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxBodyText.swift @@ -49,8 +49,8 @@ import Foundation addMolecule(stack) stack.restack() isAccessibilityElement = true - accessibilityTraits = checkbox.accessibilityTraits accessibilityHint = checkbox.accessibilityHint + accessibilityTraits = checkbox.accessibilityTraits // Update accessibility label on checkbox state change. observation = observe(\.checkbox.isSelected, options: [.new]) { [weak self] _, _ in self?.updateAccessibilityLabel() diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift index 9d036d4f..e14e91e2 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift @@ -50,9 +50,9 @@ import UIKit eyebrowHeadlineBodyLink.body.textColor = .mvmOrangeAA eyebrowHeadlineBodyLink.headline.setFontStyle(.BoldBodySmall) - accessibilityTraits = radioButton.accessibilityTraits accessibilityHint = radioButton.accessibilityHint - + accessibilityTraits = radioButton.accessibilityTraits + // Update accessibility label on radio button state change. observation = observe(\.radioButton.isSelected, options: [.new]) { [weak self] _, _ in self?.updateAccessibilityLabel() diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyText.swift index c6349aa1..a30f3f9e 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyText.swift @@ -47,8 +47,8 @@ open class ListLeftVariableRadioButtonBodyText: TableViewCell { // Make the whole cell focusable. isAccessibilityElement = true - accessibilityTraits = radioButton.accessibilityTraits accessibilityHint = radioButton.accessibilityHint + accessibilityTraits = radioButton.accessibilityTraits updateAccessibilityLabel() // Update accessibility label on radio button state change. diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift index 184abebc..6e5a7245 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift @@ -92,11 +92,18 @@ import Foundation return message.count > 0 ? message : nil } + // Ensures voice over does not read "selected" after user triggers action on cell. + override public var accessibilityTraits: UIAccessibilityTraits { + get { + return (accessoryView != nil) ? .button : .none + } + set {} + } + func updateAccessibilityLabel() { let linkShowing = link.titleLabel?.text?.count ?? 0 > 0 isAccessibilityElement = !linkShowing - accessibilityTraits = (accessoryView != nil) ? .button : .none if !linkShowing { // Make whole cell focusable if no link. accessibilityLabel = getAccessibilityMessage() diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/ThreeHeadlineBodyLink.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/ThreeHeadlineBodyLink.swift index 474907dd..5926951f 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/ThreeHeadlineBodyLink.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/ThreeHeadlineBodyLink.swift @@ -73,8 +73,8 @@ open class ThreeHeadlineBodyLink: View { bottomAnchor.constraint(equalTo: link.bottomAnchor).isActive = true isAccessibilityElement = true - accessibilityTraits = link.accessibilityTraits accessibilityHint = link.accessibilityHint + accessibilityTraits = link.accessibilityTraits updateAccessibilityLabel() } diff --git a/MVMCoreUI/BaseClasses/TableViewCell.swift b/MVMCoreUI/BaseClasses/TableViewCell.swift index caaeec85..300150e8 100644 --- a/MVMCoreUI/BaseClasses/TableViewCell.swift +++ b/MVMCoreUI/BaseClasses/TableViewCell.swift @@ -205,8 +205,8 @@ import UIKit let caret = CaretView(lineWidth: 1) caret.translatesAutoresizingMaskIntoConstraints = true caret.isAccessibilityElement = true - caret.accessibilityTraits = .button caret.accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "AccTabHint") + caret.accessibilityTraits = .button caret.size = .small(.vertical) if let size = caret.size?.dimensions() { caret.frame = CGRect(origin: CGPoint.zero, size: size) From c5b4b5dfbf559e0d166842944b1b84b954cb6247 Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Tue, 16 Jun 2020 20:53:21 +0530 Subject: [PATCH 40/80] removed new adobe method calling --- MVMCoreUI/Atomic/Organisms/Carousel.swift | 21 +++++++++---------- .../OtherHandlers/MVMCoreUILoggingHandler.h | 3 --- .../OtherHandlers/MVMCoreUILoggingHandler.m | 4 ---- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/MVMCoreUI/Atomic/Organisms/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel.swift index 71f8c198..6dde83ce 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel.swift @@ -18,7 +18,7 @@ public protocol CarouselPageControlProtocol { open class Carousel: View { - + public let collectionView: CollectionView = { let layout = UICollectionViewFlowLayout() layout.scrollDirection = .horizontal @@ -26,7 +26,7 @@ open class Carousel: View { layout.minimumLineSpacing = 0 return CollectionView(frame: .zero, collectionViewLayout: layout) }() - + /// The current index of the collection view. Includes dummy cells when looping. public var currentIndex = 0 @@ -85,7 +85,7 @@ open class Carousel: View { open func layoutCollection() { collectionView.collectionViewLayout.invalidateLayout() showPeaking(false) - + // Go to current cell. layoutIfNeeded is needed otherwise cellForItem returns nil for peaking logic. The dispatch is a sad way to ensure the collection view is ready to be scrolled. guard let model = model as? CarouselModel, (model.paging == true || model.loop == true) else { return } @@ -145,19 +145,19 @@ open class Carousel: View { collectionView.layer.borderWidth = (carouselModel.border ?? false) ? 1 : 0 backgroundColor = .white (collectionView.collectionViewLayout as? UICollectionViewFlowLayout)?.minimumLineSpacing = carouselModel.spacing ?? 0 - + itemWidthPercent = carouselModel.itemWidthPercent / 100.0 if let alignment = carouselModel.itemAlignment { itemAlignment = alignment } - + if let height = carouselModel.height { collectionViewHeight?.constant = height } registerCells(with: carouselModel, delegateObject: delegateObject) prepareMolecules(with: carouselModel) - + setupPagingMolecule(carouselModel.pagingMolecule, delegateObject: delegateObject) pageIndex = carouselModel.index @@ -185,7 +185,7 @@ open class Carousel: View { if carouselModel?.loop ?? false && newMolecules.count > 1 { // Sets up the row data with buffer cells on each side (for illusion of endless scroll... also has one more buffer cell on each side in case we can peek that cell). loop = true - + molecules?.insert(contentsOf: newMolecules.suffix(2), at: 0) molecules?.append(contentsOf: newMolecules.prefix(2)) } @@ -306,8 +306,7 @@ open class Carousel: View { let viewcontrollerObject = delegateObject?.moleculeDelegate as? MVMCoreViewControllerProtocol else { return } analyticsData[KeyAdobeTrackerPageType] = viewcontrollerObject.loadObject??.pageType analyticsData["ClassName"] = String(describing: type(of: viewcontrollerObject)) - MVMCoreUILoggingHandler.shared()?.trackAdobeAnalytics(analyticsData) - + MVMCoreUILoggingHandler.shared()?.defaultLogAction(forController: viewcontrollerObject, actionInformation: itemModel.toJSON(), additionalData: nil) } } @@ -386,7 +385,7 @@ extension Carousel: UIScrollViewDelegate { } open func scrollViewDidScroll(_ scrollView: UIScrollView) { - + // Adjust for looping if let model = model as? CarouselModel, model.loop == true { @@ -455,7 +454,7 @@ extension Carousel: UIScrollViewDelegate { } else { targetContentOffset.pointee = scrollView.contentOffset } - + // Cap the index. let lastCellIndex = collectionView(collectionView, numberOfItemsInSection: 0) - 1 goTo(min(max(cellToSwipeTo, 0), lastCellIndex), animated: true) diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.h b/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.h index 869bb098..9fec90f5 100644 --- a/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.h +++ b/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.h @@ -20,9 +20,6 @@ NS_ASSUME_NONNULL_BEGIN - (void)defaultLogActionForController:(nonnull id )controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData; - (nullable NSDictionary *)defaultGetActionTrackDataDictionaryForController:(nonnull id )controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData; -- (void)trackAdobeAnalytics:(nullable NSDictionary *)analyticsData; - - @end NS_ASSUME_NONNULL_END diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.m b/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.m index 4c99b1af..0c694cce 100644 --- a/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.m +++ b/MVMCoreUI/OtherHandlers/MVMCoreUILoggingHandler.m @@ -19,9 +19,5 @@ - (nullable NSDictionary *)defaultGetActionTrackDataDictionaryForController:(nonnull id )controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData { return nil; } -- (void)trackAnalyticsAction:(nullable NSDictionary *)analyticsData{ - -} - @end From b62bf0e00e9693527cc091012a82464d72f7292a Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Tue, 16 Jun 2020 20:56:33 +0530 Subject: [PATCH 41/80] removed spaces --- MVMCoreUI/Atomic/Organisms/Carousel.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/MVMCoreUI/Atomic/Organisms/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel.swift index 6dde83ce..61a32ffc 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel.swift @@ -18,7 +18,7 @@ public protocol CarouselPageControlProtocol { open class Carousel: View { - + public let collectionView: CollectionView = { let layout = UICollectionViewFlowLayout() layout.scrollDirection = .horizontal @@ -26,7 +26,7 @@ open class Carousel: View { layout.minimumLineSpacing = 0 return CollectionView(frame: .zero, collectionViewLayout: layout) }() - + /// The current index of the collection view. Includes dummy cells when looping. public var currentIndex = 0 @@ -85,7 +85,7 @@ open class Carousel: View { open func layoutCollection() { collectionView.collectionViewLayout.invalidateLayout() showPeaking(false) - + // Go to current cell. layoutIfNeeded is needed otherwise cellForItem returns nil for peaking logic. The dispatch is a sad way to ensure the collection view is ready to be scrolled. guard let model = model as? CarouselModel, (model.paging == true || model.loop == true) else { return } @@ -145,19 +145,19 @@ open class Carousel: View { collectionView.layer.borderWidth = (carouselModel.border ?? false) ? 1 : 0 backgroundColor = .white (collectionView.collectionViewLayout as? UICollectionViewFlowLayout)?.minimumLineSpacing = carouselModel.spacing ?? 0 - + itemWidthPercent = carouselModel.itemWidthPercent / 100.0 if let alignment = carouselModel.itemAlignment { itemAlignment = alignment } - + if let height = carouselModel.height { collectionViewHeight?.constant = height } registerCells(with: carouselModel, delegateObject: delegateObject) prepareMolecules(with: carouselModel) - + setupPagingMolecule(carouselModel.pagingMolecule, delegateObject: delegateObject) pageIndex = carouselModel.index @@ -185,7 +185,7 @@ open class Carousel: View { if carouselModel?.loop ?? false && newMolecules.count > 1 { // Sets up the row data with buffer cells on each side (for illusion of endless scroll... also has one more buffer cell on each side in case we can peek that cell). loop = true - + molecules?.insert(contentsOf: newMolecules.suffix(2), at: 0) molecules?.append(contentsOf: newMolecules.prefix(2)) } @@ -385,7 +385,7 @@ extension Carousel: UIScrollViewDelegate { } open func scrollViewDidScroll(_ scrollView: UIScrollView) { - + // Adjust for looping if let model = model as? CarouselModel, model.loop == true { @@ -454,7 +454,7 @@ extension Carousel: UIScrollViewDelegate { } else { targetContentOffset.pointee = scrollView.contentOffset } - + // Cap the index. let lastCellIndex = collectionView(collectionView, numberOfItemsInSection: 0) - 1 goTo(min(max(cellToSwipeTo, 0), lastCellIndex), animated: true) From 5d13d4d3920f77eb3b44d776da3cba386edb3f75 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Tue, 16 Jun 2020 21:30:06 +0530 Subject: [PATCH 42/80] This fixes squishing issue in iPhone 11 --- .../ListLeftVariableNumberedListAllTextAndLinks.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift index 5924b3d7..78819960 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift @@ -37,6 +37,8 @@ import Foundation //-------------------------------------------------- override open func setupView() { super.setupView() + leftLabel.setContentCompressionResistancePriority(.required, for: .horizontal) + leftLabel.setContentHuggingPriority(.defaultHigh, for: .vertical) leftLabel.setContentHuggingPriority(.defaultHigh, for: .horizontal) addMolecule(stack) stack.restack() @@ -66,12 +68,6 @@ import Foundation leftLabel.setFontStyle(.Title2XLarge) } - open override func layoutSubviews() { - super.layoutSubviews() - // This fixes a defect body text where it doesn't layout correctly. - eyebrowHeadlineBodyLink.body.preferredMaxLayoutWidth = eyebrowHeadlineBodyLink.frame.width - } - //-------------------------------------------------- // MARK: - Accessibility //-------------------------------------------------- From 7b85475ba8d3e68afe1c4aed81319999f0257acb Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 16 Jun 2020 13:34:37 -0400 Subject: [PATCH 43/80] Move hiding the line in nav bar for tab bar, to the tab bar. --- .../Atomic/Molecules/NavigationBar/NavigationItemModel.swift | 2 +- MVMCoreUI/BaseControllers/ViewController.swift | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift b/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift index bf926878..2877b250 100644 --- a/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift +++ b/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift @@ -51,7 +51,7 @@ public class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProt hidden = try typeContainer.decodeIfPresent(Bool.self, forKey: .hidden) ?? false backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) ?? Color(uiColor: .white) tintColor = try typeContainer.decodeIfPresent(Color.self, forKey: .tintColor) ?? Color(uiColor: .black) - line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line) + line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line) ?? LineModel(type: .standard) alwaysShowBackButton = try typeContainer.decodeIfPresent(Bool.self, forKey: .alwaysShowBackButton) ?? false if let backButton: (NavigationButtonModelProtocol & MoleculeModelProtocol) = try typeContainer.decodeModelIfPresent(codingKey: .backButton) { self.backButton = backButton diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index 395587ec..5e66109d 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -163,9 +163,6 @@ import UIKit open func createDefaultLegacyNavigationModel() -> NavigationItemModel { let navigationModel = NavigationItemModel() navigationModel.title = pageModel?.screenHeading - if /*(self as? MVMCoreUITabBarPageControlViewController) != nil ||*/ manager != nil || loadObject?.requestParameters?.tabWasPressed ?? false == true { - navigationModel.line = LineModel(type: .none) - } return navigationModel } From e8b2938aa2c6752ef3ff46f9cf950dc1139331a9 Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Wed, 17 Jun 2020 01:27:03 +0530 Subject: [PATCH 44/80] back button image name fix --- .../Atomic/Molecules/NavigationBar/NavigationItemModel.swift | 2 +- .../SplitViewController/MVMCoreUISplitViewController.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift b/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift index bf926878..f957f97e 100644 --- a/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift +++ b/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift @@ -19,7 +19,7 @@ public class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProt public var tintColor: Color public var line: LineModel? public var alwaysShowBackButton = false - public var backButton: (NavigationButtonModelProtocol & MoleculeModelProtocol)? = NavigationImageButtonModel(with: "back", action: ActionBackModel()) + public var backButton: (NavigationButtonModelProtocol & MoleculeModelProtocol)? = NavigationImageButtonModel(with: "nav_back", action: ActionBackModel()) public var additionalLeftButtons: [(NavigationButtonModelProtocol & MoleculeModelProtocol)]? public var additionalRightButtons: [(NavigationButtonModelProtocol & MoleculeModelProtocol)]? diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m index fe8036d2..ac5d8912 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m @@ -146,7 +146,7 @@ CGFloat const PanelAnimationDuration = 0.2; } - (nullable UIImage *)imageForBackButton { - return [MVMCoreUIUtility imageNamed:@"back"]; + return [MVMCoreUIUtility imageNamed:@"nav_back"]; } #pragma mark - Button Presses From 2e49391e9fa99a04dad466949e8f7c92be1fd700 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 17 Jun 2020 10:28:00 -0400 Subject: [PATCH 45/80] image registry --- .../Atomic/Molecules/HorizontalCombinationViews/TabBar.swift | 2 +- .../NavigationBar/Buttons/NavigationImageButtonModel.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBar.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBar.swift index 94e53790..1068f350 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBar.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBar.swift @@ -56,7 +56,7 @@ import Foundation // Add buttons var tabs: [UITabBarItem] = [] for (index, tab) in model.tabs.enumerated() { - let tabBarItem = UITabBarItem(title: tab.title, image: UIImage(named: tab.image, in: MVMCoreCache.shared()?.bundleToUseForImages(), compatibleWith: nil), tag: index) + let tabBarItem = UITabBarItem(title: tab.title, image: MVMCoreCache.shared()?.getImageFromRegisteredBundles(tab.image), tag: index) tabs.append(tabBarItem) } setItems(tabs, animated: false) diff --git a/MVMCoreUI/Atomic/Molecules/NavigationBar/Buttons/NavigationImageButtonModel.swift b/MVMCoreUI/Atomic/Molecules/NavigationBar/Buttons/NavigationImageButtonModel.swift index dc208949..4c021d5f 100644 --- a/MVMCoreUI/Atomic/Molecules/NavigationBar/Buttons/NavigationImageButtonModel.swift +++ b/MVMCoreUI/Atomic/Molecules/NavigationBar/Buttons/NavigationImageButtonModel.swift @@ -38,7 +38,7 @@ public class NavigationImageButtonModel: NavigationButtonModelProtocol, Molecule /// Convenience function that creates a BarButtonItem for the model. public func createNavigationItemButton(delegateObject: MVMCoreUIDelegateObject? = nil, additionalData: [AnyHashable: Any]? = nil) -> UIBarButtonItem { - let imageName = UIImage(named: image, in: MVMCoreCache.shared()?.bundleToUseForImages(), compatibleWith: nil) - return ImageBarButtonItem.create(with: imageName, actionModel: action, delegateObject: delegateObject, additionalData: additionalData) + let uiImage = MVMCoreCache.shared()?.getImageFromRegisteredBundles(image) + return ImageBarButtonItem.create(with: uiImage, actionModel: action, delegateObject: delegateObject, additionalData: additionalData) } } From 91e3df6a5d8b7101385e7f9d53c32b96d4beebfd Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Wed, 17 Jun 2020 21:04:24 +0530 Subject: [PATCH 46/80] moved nav_back and nav_close images to CoreUI --- .../Media.xcassets/back.imageset/back.png | Bin 242 -> 0 bytes .../Media.xcassets/back.imageset/back@2x.png | Bin 414 -> 0 bytes .../Media.xcassets/back.imageset/back@3x.png | Bin 588 -> 0 bytes .../closeXBlack.imageset/closeXBlack.png | Bin 215 -> 0 bytes .../closeXBlack.imageset/closeXBlack@2x.png | Bin 374 -> 0 bytes .../closeXBlack.imageset/closeXBlack@3x.png | Bin 535 -> 0 bytes .../Contents.json | 6 +++--- .../Media.xcassets/nav_back.imageset/nav_back.png | Bin 0 -> 183 bytes .../nav_back.imageset/nav_back@2x.png | Bin 0 -> 335 bytes .../nav_back.imageset/nav_back@3x.png | Bin 0 -> 488 bytes .../Contents.json | 6 +++--- .../nav_close.imageset/nav_close.png | Bin 0 -> 268 bytes .../nav_close.imageset/nav_close@2x.png | Bin 0 -> 488 bytes .../nav_close.imageset/nav_close@3x.png | Bin 0 -> 738 bytes .../MVMCoreUICommonViewsUtility+Extension.swift | 2 +- 15 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/back.imageset/back.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/back.imageset/back@2x.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/back.imageset/back@3x.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/closeXBlack.imageset/closeXBlack.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/closeXBlack.imageset/closeXBlack@2x.png delete mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/closeXBlack.imageset/closeXBlack@3x.png rename MVMCoreUI/SupportingFiles/Media.xcassets/{back.imageset => nav_back.imageset}/Contents.json (70%) create mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back.png create mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back@2x.png create mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back@3x.png rename MVMCoreUI/SupportingFiles/Media.xcassets/{closeXBlack.imageset => nav_close.imageset}/Contents.json (69%) create mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/nav_close.png create mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/nav_close@2x.png create mode 100644 MVMCoreUI/SupportingFiles/Media.xcassets/nav_close.imageset/nav_close@3x.png diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/back.imageset/back.png b/MVMCoreUI/SupportingFiles/Media.xcassets/back.imageset/back.png deleted file mode 100644 index 3d2734b6d82d8bedda73e882689e9b569807b165..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 242 zcmeAS@N?(olHy`uVBq!ia0vp^AhsX}8v_I5WEI|GAcwIy$lZxy-8q?;K+YOZ7sn6{ z(c}aNCPR;$wu}@$p=!mBvn-+l4wD=Vb~^Z&vB>u}>l|b-;#(u9(siiurXt^zAFPv( zvV}3QMsD<6(9zg)t6Rq@f?>%o13n|(&x)HQ zxTKdbh^Q%SKg`S-$yzF+b10qlgw+Jo{|ymR9q|kw{T0+WZZv9bWBM4SpeEz$;HndF oRKZu_EDNJX!gPj0J`Yufsrq8I%G*8P0Nu^t>FVdQ&MBb@018z}k^lez diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/back.imageset/back@2x.png b/MVMCoreUI/SupportingFiles/Media.xcassets/back.imageset/back@2x.png deleted file mode 100644 index 1d64be8bc2b69fb7abcf91510f075c1e989d85fa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 414 zcmV;P0b%}$P)Px$SV=@dR7ef&l+8*5K@fyjy{Hj?F^C9>BA5r%=g{ZLK~NDC1VIo4QGz1+7Fyqi zp2KD~JxU)0EvR%)Pfg8k&t$7AgL$i^#0vM8SUj>M#Q|CUlS(O>N!d8Tzi%}L6YEAc zn~T@EVz&0#tp1>27FU)u<3w{zFtX&^k)G6#I@_|;1bxjnyIU_Y!Jx&Uas{^VP05)J zO5&qLwz`Dh1+QS1AEqKulL$EJ!iustN@Bdk@97??ZvbSb`Dvnpfa%w|*})Hx>Uz zQ`=Kd{=OdZSo`9K$Q8H{7sU`@{3>F6DK3j4=*i_-#P~*B6GN~qmj@B!J8@GCL02vq zV$23?6oPfR&;pE~#GV)e4vRy>_(kL}L(q}Ssfh7$h-1#=3r_P?)1&fRssI2007*qo IM6N<$g6C+k%K!iX diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/back.imageset/back@3x.png b/MVMCoreUI/SupportingFiles/Media.xcassets/back.imageset/back@3x.png deleted file mode 100644 index 147e2c6ad7dedcd7b68ee3841838cf4504b13205..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 588 zcmV-S0<-;zP)Px%21!IgR9Fe^SZOOoQ51cKe;|k|d@427gn&C?Av|G9>f(%tNeI zXTPpGcVFl9I>g6_FyY@WZPV}ZRYkqavq%cg=95}6MY?u zF23b|5sEV017yDfRnanW{uKgUalz>RHWo9{4Xa;d-OXfHv7fcY7+CnJfau1~_%|g; zFHWyZPT3}zp9x1|{aoS-{zVes>l?sflyl*0Pav{Loo@m1c>S8I%E$}nE637nwNR!C-`|e6kiOR&%;V8o?L`<&H4JA(v%_7S0?UtIQ z1Sd^_JtapCjhF(5YL*i0Hw8|W95vK!3S6pLO0eA&xK(o0P_rp;uVyL1dQ*T$k(X72 z#qYt37aODsQ-CL`mz9Dw>c#vQB>oi2T^JvRyiO^XNks+aWOKS_bP;22D(E_~#Qb!m zi6e4NNJr{AvBdmhWUK)El@Tl^vhtX~hZK1dWCOgL;&~R#rlG`>SKj>&{F-3u5E=&_ z0cqd>eghE92BCBZNCU_4TY{-Ws28{aq=9qz9Y8Sagwh2d4P3+T38oIAR^SAX2D0!6 zfMC`LB|Zg61H8={3#JaCT3{ED2A<(h0l};iN}GT*z(0EDf~iBO3|Ir$0LRbEGN={U a)II@r8otkpGSzGV0000 zPH_}!P~dQ#+ZQ1I`d@j*%{a|KqaQ1hjrlnK*Uk`Y`%vfJXS{I3l$e)ug!PUH>^Amp zwVo?zJlRm%#@8kMHP@$WvA30tuLyHr4`JRCrRt#OIFtEE-p0n?{${t6W81ec)cCxR zQ)Px$FiAu~R9Fekm|+gWAPj{UPr`q_|9SZBCA3vp7&7+yC~Qs0q_ppQu(%~#mJ3G^ zZ;uoFDO1^-2r`Q@o-$^dQkF8Kj38r;yZq9H*Y7&RR5Fv8>R}UQ!AMgu3ohJj#WpcB z%nb%Vv^L$?FxRcwEs&XW)AA7V(8%`oeJ-(&1a~vZ86(W}Bp!6N04%i-e6I)rAvJsY zRK5jltx+(vsRpj)P(7Er(g6EUbTN}ea#QK8tvNbwbms*d^V8AWb?PlE&FH+An{tjV zaBFRdIRuE*xR|qmEVYz52Eg<{=6ZyCdaLF<1U)o9=G=rtty`;GpmN@{Cf!&uQKrn= z=7y38%wYyx2tbcY4q2D`*brn(QHH*;)%~nUClv)4N~k9OK8ch?1Ln#M19W{P-_;Ag UXN9MmJpcdz07*qoM6N<$g7AT$p8x;= diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/closeXBlack.imageset/closeXBlack@3x.png b/MVMCoreUI/SupportingFiles/Media.xcassets/closeXBlack.imageset/closeXBlack@3x.png deleted file mode 100644 index 598475659e712adada27405d4a675351fa7a3a92..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 535 zcmV+y0_gpTP)Px$(Md!>RA>e5nq5xAFc5?*o_OZsy$-kFNZ_gDDr(m0{>+#dYRPJecW1tF3{p@o zm)BT(2i_b0wat%(Vt^IQU^fRAKHL0m^Q+Aj!hsR2Ute6MbQRM^7L))=Z7a+D+6?0v9```_ zGShIH*EFNeR?0o)2AeRCUuE7h;l~6AKhqiLf(P)=mS`+Ap=ZQ_^)gdgAOIUJO|zvN zqlAU}Fk`r(09S1dv0j^7|3^#sjh8BEqTdRK47>4XU+Y6sghOiV#wr7>U^d@XTqVSd Z^9Mh_uZWnsYPA3W002ovPDHLkV1mNA@q_>X diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/back.imageset/Contents.json b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/Contents.json similarity index 70% rename from MVMCoreUI/SupportingFiles/Media.xcassets/back.imageset/Contents.json rename to MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/Contents.json index 3bad3d0c..65a64dfd 100644 --- a/MVMCoreUI/SupportingFiles/Media.xcassets/back.imageset/Contents.json +++ b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "back.png", + "filename" : "nav_back.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "back@2x.png", + "filename" : "nav_back@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "back@3x.png", + "filename" : "nav_back@3x.png", "scale" : "3x" } ], diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back.png b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back.png new file mode 100644 index 0000000000000000000000000000000000000000..2592ddda043233e967fa1a81123d0ff7f42fe64c GIT binary patch literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%1|*NXY)uAIjKx9jP7LeL$-D$|3O!vMLp*qs z6BJ}OOj_4!A}izY)Vg6uw@L1i)oqa<_*bYlR{)tZTN@H0df6^!2ng~pE)p?e2>r|c z=&8#}wP3-sleN#pE*3lJ)RaaS&-vd?0YePIyjF-{YThA|Eo3dToi`V7$3%+CLT7MbFch&so0wqA%y3s^34C z>6_J9+KA4#D4S^zU-SRd!@4<#3JYT&o&GG{7qmk+jZ;x4)JK0Asg&Hh&T?{#r3-X^t-YRPje({x6V$QC3q-|%lxQ`a?4tgysk_)j%dw0 zBA0svwgv6bTqdcQv$P=C$JptH*TZEq(pol5J>+Y67Oe4+;%v)L9PLJWUD<_S7E1lo juj)wlyPo>*>py1ZhF!A@x`h`2Lx{oC)z4*}Q$iB}#6*De literal 0 HcmV?d00001 diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back@3x.png b/MVMCoreUI/SupportingFiles/Media.xcassets/nav_back.imageset/nav_back@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..f2ac8c73bba31fb9e6054699464c39704db9ccb0 GIT binary patch literal 488 zcmeAS@N?(olHy`uVBq!ia0vp^-XP4u1|%)~s$Kyp#^NA%Cx&(BWL^T3RBMG%i${+%kJISUGj9n zKCh=+w)EVw31E7p6yWDpwSeV_>w-BwUmQ3)x*aSfUp5K}h&L7)U1C;M&|`Xl~C z%s#@l;l$NALYF&MfVfLRVjLbPf z2}RcGJR3Y4PrjXFa6pY!ZF}({hS?%B?wsTNt!yxFeyYOPmX9fB%%-mxj~V}OJJB3I iPwgi|$H#iXAB=b3t_^BYk7@!&9fPNP000>X1^@s6#OZ}&00001b5ch_0Itp) z=>Px##z{m$R7efImQfDFAPhs>kKO-gC+SsopeotRks*c3#0a{N50Gz{+0~47bt{2|lUMut2BJNa`y}2*yOP)Px$qDe$SRA>e5noADCFbqTyT!9VuUvMRE12MvamL&Ky6QvcAs+Pu{d6U4RsE5N& z$GPM>Z6KR43Tt&-%H3NzuH~3HjIar#unO~HNIIFgzm8eMXb9yL=Ecse3#4$iFlI(` zVF@{UxY^td0}_Rq!i|JbX_mAAAQX%NCKLz-_l64^LeV^F!j({TFSr%io4o$=|jx+t|Un+u`IT48Aa102=)fBs&9)^6z6i?%D@DDgYB z5CXobAA2i=-0#iBmyOVA0kzZ+(Cm^PKu@im08kkLi}V0c+Y%X|OmCYgFoOU=XavyT zEl2>Q)|=39#V}@QcB3#2nc9m`BaG-Cbc2s2qj}MUKj7Dwa8J14nz-{B<_#0-!2X&_ zGo%H65jy6>Ea656oVV1?002t}1^@s6I8J)%00001b5ch_0Itp) z=>Px%oJmAMRCodHoLg?fFc3xg>}NO9f0o{5l@+v}(m_#**Gmc@u!v#)44dxS8C@DC&KX}0;;LLoP z6%GPt?#H}=6F4^?ZjFq}#GJhU-%J(y8cA(TN>9h5J#I-^EM^UaJ|71kQo=2`i0 ztJ`b5H{Q*NS0gC^X`Gktus$si??qXryBT4ixbYFNuM)Jq-NWxAZu_v_@c9TB1LApV zP<*5$z!oT`Rc5+I)lNP7p7yU%2&|PQTm}+Q>zdVAQMFTY%4^rriXtF%jiQ-X)pni= zSPK;Gry-5IN59}}FM!_omqDgAuFX3wxKYES`KJMgGK#8`7983jx?UP^R>rLAhJmv- zWL@74oR<-=K4##&4S4s1fr}Cz)mIHJT5xoKF}N&3v*@UT%O)_Jo(H(B!qVwVC+Kkq z?{CuROCw|lX#X)>XSjepk;dmRy Button { let button = Button() - if let image = MVMCoreUIUtility.imageNamed("closeXBlack")?.withRenderingMode(.alwaysTemplate) { + if let image = MVMCoreUIUtility.imageNamed("nav_close")?.withRenderingMode(.alwaysTemplate) { button.setImage(image, for: .normal) } button.tintColor = .black From 304a5f60217908953f0aa0558db3cce15aed8ec1 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 17 Jun 2020 14:01:44 -0400 Subject: [PATCH 47/80] split color change --- .../SplitViewController/MVMCoreUISplitViewController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m index ac5d8912..b6d4f812 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m @@ -918,7 +918,7 @@ CGFloat const PanelAnimationDuration = 0.2; self.extendedDrawers = MFExtendedDrawerLeft | MFExtendedDrawerRight; self.prioritizedExtendedPanel = MFExtendedDrawerLeft; - self.view.backgroundColor = [UIColor blackColor]; + self.view.backgroundColor = [UIColor whiteColor]; } - (void)viewDidLayoutSubviews { From 0cf5d641e97c31d2621eb4de2b319fedb3ca3a77 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 17 Jun 2020 22:17:10 -0400 Subject: [PATCH 48/80] Wishlist update --- .../SplitViewController/MVMCoreUISplitViewController.m | 1 + 1 file changed, 1 insertion(+) diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m index b6d4f812..d5124769 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m @@ -1069,6 +1069,7 @@ CGFloat const PanelAnimationDuration = 0.2; if ([self.rightPanelButton respondsToSelector:@selector(setIconColor:)]) { [((UIBarButtonItem *)self.rightPanelButton) setIconColor:color]; } + [self.backButton setTintColor:color]; } @end From 728a3ca62284117d36b519f1b37638c93326e89a Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 17 Jun 2020 22:23:40 -0400 Subject: [PATCH 49/80] order fix --- .../SplitViewController/MVMCoreUISplitViewController.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m index d5124769..82594e53 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m @@ -237,12 +237,12 @@ CGFloat const PanelAnimationDuration = 0.2; - (void)setLeftNavigationItemForViewController:(UIViewController * _Nonnull)viewController accessible:(BOOL)accessible extended:(BOOL)extended { NSMutableArray *leftBarButtonItems = [NSMutableArray array]; NSArray *extraButtons = [self additionalLeftButtonsForViewController:viewController]; - if (extraButtons) { - [leftBarButtonItems addObjectsFromArray:extraButtons]; - } if ((accessible && !extended) && self.leftPanelButton && ![extraButtons containsObject:self.leftPanelButton]) { [leftBarButtonItems addObject:self.leftPanelButton]; } + if (extraButtons) { + [leftBarButtonItems addObjectsFromArray:extraButtons]; + } [viewController.navigationItem setLeftBarButtonItems:(leftBarButtonItems.count > 0 ? leftBarButtonItems : nil) animated:!DisableAnimations]; } From 82fbf6dc8edffdd24729dc5f4201e865fa613b01 Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Thu, 18 Jun 2020 08:26:12 +0530 Subject: [PATCH 50/80] Scott feedback implemented --- MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift | 4 ++-- MVMCoreUI/Atomic/Organisms/Carousel.swift | 7 ++----- .../ModelProtocols/CarouselItemModelProtocol.swift | 7 ++++--- MVMCoreUI/Utility/MVMCoreUIConstants.h | 4 ---- MVMCoreUI/Utility/MVMCoreUIConstants.m | 4 ---- 5 files changed, 8 insertions(+), 18 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift index 9165cec7..5103b440 100644 --- a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift +++ b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift @@ -10,7 +10,7 @@ import Foundation @objcMembers public class CarouselItemModel: MoleculeCollectionItemModel, CarouselItemModelProtocol { - public var analyticsData: [String : String]? + public var analyticsData: JSONValueDictionary? //-------------------------------------------------- // MARK: - Properties @@ -41,7 +41,7 @@ import Foundation let typeContainer = try decoder.container(keyedBy: CodingKeys.self) peakingUI = try typeContainer.decodeIfPresent(Bool.self, forKey: .peakingUI) peakingArrowColor = try typeContainer.decodeIfPresent(Color.self, forKey: .peakingArrowColor) - analyticsData = try typeContainer.decodeIfPresent([String:String].self, forKey: .analyticsData) + analyticsData = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .analyticsData) try super.init(from: decoder) } diff --git a/MVMCoreUI/Atomic/Organisms/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel.swift index 61a32ffc..40ed5e63 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel.swift @@ -302,11 +302,8 @@ open class Carousel: View { } func trackSwipeActionAnalyticsforIndex(_ index : Int){ guard let itemModel = molecules?[index], - var analyticsData = itemModel.analyticsData, - let viewcontrollerObject = delegateObject?.moleculeDelegate as? MVMCoreViewControllerProtocol else { return } - analyticsData[KeyAdobeTrackerPageType] = viewcontrollerObject.loadObject??.pageType - analyticsData["ClassName"] = String(describing: type(of: viewcontrollerObject)) - MVMCoreUILoggingHandler.shared()?.defaultLogAction(forController: viewcontrollerObject, actionInformation: itemModel.toJSON(), additionalData: nil) + let viewControllerObject = delegateObject?.moleculeDelegate as? MVMCoreViewControllerProtocol else { return } + MVMCoreUILoggingHandler.shared()?.defaultLogAction(forController: viewControllerObject, actionInformation: itemModel.toJSON(), additionalData: nil) } } diff --git a/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift b/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift index 2d8444b5..3501ce42 100644 --- a/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift @@ -10,11 +10,12 @@ import Foundation public protocol CarouselItemModelProtocol: ContainerModelProtocol { - var analyticsData: [String:String]? { get } + var analyticsData: JSONValueDictionary? { get set } } public extension CarouselItemModelProtocol { - var analyticsData: [String:String]? { - get { return nil} + var analyticsData: JSONValueDictionary? { + get { return nil } + set{ analyticsData = newValue } } } diff --git a/MVMCoreUI/Utility/MVMCoreUIConstants.h b/MVMCoreUI/Utility/MVMCoreUIConstants.h index c70f9e84..4c0a3553 100644 --- a/MVMCoreUI/Utility/MVMCoreUIConstants.h +++ b/MVMCoreUI/Utility/MVMCoreUIConstants.h @@ -82,7 +82,3 @@ typedef NS_ENUM(NSInteger, CoreUIErrorCode) { #pragma mark - Apple Design Guidelines extern CGFloat const MinimumTappableArea; - -#pragma mark - Adobe Action Tracking - -extern NSString * const KeyAdobeTrackerPageType; diff --git a/MVMCoreUI/Utility/MVMCoreUIConstants.m b/MVMCoreUI/Utility/MVMCoreUIConstants.m index 34e3dc8c..5f5a9a45 100644 --- a/MVMCoreUI/Utility/MVMCoreUIConstants.m +++ b/MVMCoreUI/Utility/MVMCoreUIConstants.m @@ -74,7 +74,3 @@ NSString * const KeyHandScroll = @"hand_scroll"; #pragma mark - Apple Design Guidelines CGFloat const MinimumTappableArea = 44.0f; - -#pragma mark - Adobe Action Tracking - -NSString * const KeyAdobeTrackerPageType = @"vzwi.mvmapp.PageType"; From b68e0dd80c6ecbf8c5de149551c9af1b8c38b087 Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Thu, 18 Jun 2020 16:01:08 +0530 Subject: [PATCH 51/80] duplicate tracking fixed --- MVMCoreUI/Atomic/Organisms/Carousel.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MVMCoreUI/Atomic/Organisms/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel.swift index 40ed5e63..c6166d39 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel.swift @@ -68,6 +68,8 @@ open class Carousel: View { private var size: CGFloat? + private var isTrackedAnalytics: Bool = false + // Updates the model and index. public func updateModelIndex() { (model as? CarouselModel)?.index = pageIndex @@ -165,7 +167,10 @@ open class Carousel: View { collectionView.reloadData() // track analyticsData + if(!isTrackedAnalytics){ trackSwipeActionAnalyticsforIndex(pageIndex) + isTrackedAnalytics = true + } } //-------------------------------------------------- From 69712928fc521acdea4489b6e6079730c10e271d Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 18 Jun 2020 15:46:52 -0400 Subject: [PATCH 52/80] fix for double tracking Change the way the navigation bar is updated. --- MVMCoreUI.xcodeproj/project.pbxproj | 4 + .../BaseControllers/ViewController.swift | 53 +++----- .../Containers/NavigationController.swift | 9 +- .../MVMCoreUIDetailViewProtocol.h | 3 + ...MCoreUISplitViewController+Extension.swift | 122 ++++++++++++++++++ .../MVMCoreUISplitViewController.h | 10 +- .../MVMCoreUISplitViewController.m | 62 ++++++--- 7 files changed, 201 insertions(+), 62 deletions(-) create mode 100644 MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController+Extension.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 114dd245..bcd50510 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -323,6 +323,7 @@ D27CD40E2322EEAF00C1DC07 /* TabsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D27CD40D2322EEAF00C1DC07 /* TabsTableViewCell.swift */; }; D27CD4102339057800C1DC07 /* EyebrowHeadlineBodyLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = D27CD40F2339057800C1DC07 /* EyebrowHeadlineBodyLink.swift */; }; D282AABA224131D100C46919 /* MFTransparentGIFView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D282AAB9224131D100C46919 /* MFTransparentGIFView.swift */; }; + D2874024249BA6F300BE950A /* MVMCoreUISplitViewController+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2874023249BA6F300BE950A /* MVMCoreUISplitViewController+Extension.swift */; }; D28764AA2458980300CB882D /* ThreeLayerFillMiddleTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D28764A92458980300CB882D /* ThreeLayerFillMiddleTemplate.swift */; }; D28764AC245898A400CB882D /* ThreeLayerFillMiddleTemplateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D28764AB245898A400CB882D /* ThreeLayerFillMiddleTemplateModel.swift */; }; D28764F9245A327200CB882D /* TwoLinkView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D28764F8245A327200CB882D /* TwoLinkView.swift */; }; @@ -769,6 +770,7 @@ D27CD40D2322EEAF00C1DC07 /* TabsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabsTableViewCell.swift; sourceTree = ""; }; D27CD40F2339057800C1DC07 /* EyebrowHeadlineBodyLink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EyebrowHeadlineBodyLink.swift; sourceTree = ""; }; D282AAB9224131D100C46919 /* MFTransparentGIFView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MFTransparentGIFView.swift; sourceTree = ""; }; + D2874023249BA6F300BE950A /* MVMCoreUISplitViewController+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MVMCoreUISplitViewController+Extension.swift"; sourceTree = ""; }; D28764A92458980300CB882D /* ThreeLayerFillMiddleTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreeLayerFillMiddleTemplate.swift; sourceTree = ""; }; D28764AB245898A400CB882D /* ThreeLayerFillMiddleTemplateModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreeLayerFillMiddleTemplateModel.swift; sourceTree = ""; }; D28764F8245A327200CB882D /* TwoLinkView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TwoLinkView.swift; sourceTree = ""; }; @@ -1813,6 +1815,7 @@ D29DF15321E69760003B2FB9 /* MVMCoreUIPanelButtonProtocol.h */, D29DF11A21E684A9003B2FB9 /* MVMCoreUISplitViewController.h */, D29DF11B21E684A9003B2FB9 /* MVMCoreUISplitViewController.m */, + D2874023249BA6F300BE950A /* MVMCoreUISplitViewController+Extension.swift */, ); path = SplitViewController; sourceTree = ""; @@ -2261,6 +2264,7 @@ 942C378E2412F5B60066E45E /* ModalMoleculeStackTemplate.swift in Sources */, 8D8067D32444473A00203BE8 /* ListRightVariablePriceChangeAllTextAndLinks.swift in Sources */, 8D4687E4242E2DF300802879 /* ListFourColumnDataUsageListItem.swift in Sources */, + D2874024249BA6F300BE950A /* MVMCoreUISplitViewController+Extension.swift in Sources */, 01F2A03223A4498200D954D8 /* CaretLinkModel.swift in Sources */, 0A7BAFA1232BE61800FB8E22 /* Checkbox.swift in Sources */, 011B58F023A2AA980085F53C /* ListItemModelProtocol.swift in Sources */, diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index 5e66109d..5ff6c893 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -196,18 +196,8 @@ import UIKit // We additionally want our left items navigationItem.leftItemsSupplementBackButton = true - NavigationController.set(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) - - // Special logic when using the split view controller. Legacy Update Panels. Change how this is done. - guard navigationController == MVMCoreUISplitViewController.main()?.navigationController, - navigationController.topViewController == viewController else { return } - - MVMCoreUISession.sharedGlobal()?.splitViewController?.setupPanels() - showBottomProgressBar() - - MVMCoreUISplitViewController.main()?.setLeftPanelIsAccessible(isMasterInitiallyAccessible(), for: viewController) - MVMCoreUISplitViewController.main()?.setRightPanelIsAccessible(isSupportInitiallyAccessible(), for: viewController) - MVMCoreUISession.sharedGlobal()?.splitViewController?.setNavigationIconColor(navigationItemModel.tintColor.uiColor) + // Utilize helper function to set the split view and navigation item state. + MVMCoreUISplitViewController.setSplitViewController(for: viewController, navigationController: navigationController, navigationItemModel: navigationItemModel, leftPanelAccessible: isMasterInitiallyAccessible(), rightPanelAccessible: isSupportInitiallyAccessible(), progress: bottomProgress()) } // Eventually will be moved to server @@ -249,12 +239,10 @@ import UIKit } // Eventually will be moved to Model - open func showBottomProgressBar() { - if MVMCoreUISplitViewController.main()?.getCurrentVisibleController() == self, - let progressString = loadObject?.pageJSON?.optionalStringForKey(KeyProgressPercent), - let progress = Float(progressString) { - MVMCoreUISplitViewController.main()?.setBottomProgressBarProgress(progress / Float(100)) - } + open func bottomProgress() -> Float? { + guard let progressString = loadObject?.pageJSON?.optionalStringForKey(KeyProgressPercent), + let progress = Float(progressString) else { return nil } + return (progress / Float(100)) } // MARK: - TabBar @@ -318,24 +306,23 @@ import UIKit super.viewDidLayoutSubviews() } - open override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) + open func pageShown() { + // Update the navigation bar ui when view is appearing. + setNavigationController() - // Update the navigation bar ui when view is appearing. Can remove check in the future, see viewControllerReady - if manager == nil { - setNavigationController() - } + // Update tab if needed. + updateTabBar() + + // Track. + MVMCoreUISession.sharedGlobal()?.currentPageType = pageType + MVMCoreUILoggingHandler.shared()?.defaultLogPageState(forController: self) } open override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - // Update tab if needed. - updateTabBar() - if manager == nil { - MVMCoreUISession.sharedGlobal()?.currentPageType = pageType - MVMCoreUILoggingHandler.shared()?.defaultLogPageState(forController: self) + pageShown() } executeBehaviors { (behavior: PageVisibilityBehavior) in @@ -372,13 +359,7 @@ import UIKit // MARK: - MVMCoreViewManagerViewControllerProtocol open func viewControllerReady(inManager manager: UIViewController & MVMCoreViewManagerProtocol) { - // TODO: This check and set aren't technically needed anymore. The one in viewwillappear should be enough. However, there is a timing issue with the manager where the screen lays out before the menu shows, so the screen grows off the screen. Can fix in the future. - if let _ = self.view { - setNavigationController() - } - // Janky way to track current page. - MVMCoreUISession.sharedGlobal()?.currentPageType = pageType - MVMCoreUILoggingHandler.shared()?.defaultLogPageState(forController: self) + pageShown() } // MARK: - MVMCoreLoadDelegateProtocol diff --git a/MVMCoreUI/Containers/NavigationController.swift b/MVMCoreUI/Containers/NavigationController.swift index 0d4d0a56..12d70634 100644 --- a/MVMCoreUI/Containers/NavigationController.swift +++ b/MVMCoreUI/Containers/NavigationController.swift @@ -67,8 +67,8 @@ import UIKit viewController.navigationItem.rightBarButtonItems = rightItems.count > 0 ? rightItems : nil } - /// Convenience function for setting navigation bar with model. - public static func set(navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, viewController: UIViewController) { + /// Convenience function for setting the navigation bar ui, except for the buttons. + public static func setNavigationUI(navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, viewController: UIViewController) { viewController.navigationItem.title = navigationItemModel.title viewController.navigationItem.accessibilityLabel = navigationItemModel.title viewController.navigationItem.hidesBackButton = (navigationItemModel.backButton != nil) @@ -86,8 +86,11 @@ import UIKit if let navigationController = navigationController as? NavigationController { navigationController.separatorView?.isHidden = navigationItemModel.line?.type ?? .standard == .none } + } - // Sets up the navigation buttons. + /// Convenience function for setting navigation bar with model. + public static func set(navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, viewController: UIViewController) { + setNavigationUI(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) setNavigationButtons(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) } diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUIDetailViewProtocol.h b/MVMCoreUI/Containers/SplitViewController/MVMCoreUIDetailViewProtocol.h index 377508c7..2ec18da9 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUIDetailViewProtocol.h +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUIDetailViewProtocol.h @@ -42,6 +42,9 @@ NS_ASSUME_NONNULL_BEGIN - (UIStatusBarStyle)defaultStatusBarStyle; - (nullable UIColor *)defaultStatusBarBackgroundColor; +/// Called when the split view did reset. If this function found, the splitview assumes it is handling the split view state and does not do anything. If you have navigation item buttons, override this function and handle the panels manually. +- (void)splitViewDidReset; + @end NS_ASSUME_NONNULL_END diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController+Extension.swift b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController+Extension.swift new file mode 100644 index 00000000..ed4f931c --- /dev/null +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController+Extension.swift @@ -0,0 +1,122 @@ +// +// MVMCoreUISplitViewController+Extension.swift +// MVMCoreUI +// +// Created by Scott Pfeil on 6/18/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public extension MVMCoreUISplitViewController { + + /// Convenience function. Sets the navigation and split view properties for the view controller. + static func setSplitViewController(for viewController: UIViewController, navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, leftPanelAccessible: Bool, rightPanelAccessible: Bool, progress: Float? = nil) { + guard let splitView = MVMCoreUISplitViewController.main(), + navigationController == splitView.navigationController, + navigationController.topViewController == viewController else { + NavigationController.set(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) + return + } + splitView.set(for: viewController, navigationController: navigationController, navigationItemModel: navigationItemModel, leftPanelAccessible: leftPanelAccessible, rightPanelAccessible: rightPanelAccessible, progress: progress) + } + + /// Sets the navigation item for the view controller based on the model and splitview controller + func set(for viewController: UIViewController, navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, leftPanelAccessible: Bool, rightPanelAccessible: Bool, progress: Float? = nil) { + + // Setup the panels. + MVMCoreUISession.sharedGlobal()?.splitViewController?.setupPanels() + + NavigationController.setNavigationUI(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) + + MVMCoreUISplitViewController.main()?.setLeftPanelIsAccessible(leftPanelAccessible, for: viewController, updateNavigationButtons: false) + MVMCoreUISplitViewController.main()?.setRightPanelIsAccessible(rightPanelAccessible, for: viewController, updateNavigationButtons: false) + + setLeftNavigationButtons(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) + setRightNavigationButtons(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) + + MVMCoreUISession.sharedGlobal()?.splitViewController?.setNavigationIconColor(navigationItemModel.tintColor.uiColor) + + setBottomProgressBarProgress(progress ?? 0) + } + + /// Sets the left navigation items for the view controller based on model and splitview. + func setLeftNavigationButtons(navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol?, viewController: UIViewController) { + var leftItems: [UIBarButtonItem] = [] + let delegate = (viewController as? MVMCoreViewControllerProtocol)?.delegateObject?() as? MVMCoreUIDelegateObject + + // Add back button first. + if let backButtonModel = navigationItemModel?.backButton { + if navigationController.viewControllers.count > 1 || navigationItemModel!.alwaysShowBackButton { + leftItems.append(backButtonModel.createNavigationItemButton(delegateObject: delegate, additionalData: nil)) + } + } else if let backButton = backButton, + navigationController.viewControllers.count > 1 { + leftItems.append(backButton) + } + + // Add the panel button after the back button. + if let panelButton = leftPanelButton, + leftPanelIsAccessible, + !leftPanelStaysExtended() { + leftItems.append(panelButton) + } + + // Add other model buttons + if let leftItemModels = navigationItemModel?.additionalLeftButtons { + for item in leftItemModels { + leftItems.append(item.createNavigationItemButton(delegateObject: delegate, additionalData: nil)) + } + } + + // Add any buttons added by the splitview. + if let additionalLeftButtons = additionalLeftButtons(for: viewController) { + leftItems.append(contentsOf: additionalLeftButtons) + } + + viewController.navigationItem.setLeftBarButtonItems(leftItems.count > 0 ? leftItems : nil, animated: !DisableAnimations.boolValue) + } + + /// Sets the right navigation items for the view controller based on model and splitview. + func setRightNavigationButtons(navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol?, viewController: UIViewController) { + let delegate = (viewController as? MVMCoreViewControllerProtocol)?.delegateObject?() as? MVMCoreUIDelegateObject + var rightItems: [UIBarButtonItem] = [] + + // Add the panel button first. + if let panelButton = rightPanelButton, + rightPanelIsAccessible, + !rightPanelStaysExtended() { + rightItems.append(panelButton) + } + + // Add other model buttons + if let rightItemModels = navigationItemModel?.additionalRightButtons { + for item in rightItemModels { + rightItems.append(item.createNavigationItemButton(delegateObject: delegate, additionalData: nil)) + } + } + + // Add any buttons added by the splitview. + if let additionalRightButtons = additionalRightButtons(for: viewController) { + rightItems.append(contentsOf: additionalRightButtons) + } + + viewController.navigationItem.setRightBarButtonItems(rightItems.count > 0 ? rightItems : nil, animated: !DisableAnimations.boolValue) + } + + // MARK: - Legacy Functions + /// Convenience setter for legacy files. Sets the navigation item for the view controller based on the json and splitview controller + @objc static func setSplitViewController(for viewController: UIViewController, navigationController: UINavigationController, navigationJSON: [String: Any], leftPanelAccessible: Bool, rightPanelAccessible: Bool, progress: NSNumber?) throws { + guard let navigationItemModel = try MoleculeObjectMapping.shared()?.getMoleculeModelForJSON(navigationJSON) as? (MoleculeModelProtocol & NavigationItemModelProtocol) else { + throw ModelRegistry.Error.decoderOther(message: "Model not a bar model") + } + guard let splitView = MVMCoreUISplitViewController.main(), + navigationController == splitView.navigationController, + navigationController.topViewController == viewController else { + NavigationController.set(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) + return + } + let progress = progress?.floatValue + splitView.set(for: viewController, navigationController: navigationController, navigationItemModel: navigationItemModel, leftPanelAccessible: leftPanelAccessible, rightPanelAccessible: rightPanelAccessible, progress: progress) + } +} diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h index 4d6b2cff..c48c9e8c 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.h @@ -67,10 +67,10 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) { #pragma mark - Panel Functions // Sets if the left panel accessible for the view controller. Will show or hide the button. -- (void)setLeftPanelIsAccessible:(BOOL)leftPanelIsAccessible forViewController:(nonnull UIViewController *)viewController; +- (void)setLeftPanelIsAccessible:(BOOL)leftPanelIsAccessible forViewController:(nonnull UIViewController *)viewController updateNavigationButtons:(BOOL)updateNavigationButtons; // Sets if the right panel accessible for the view controller. Will show or hide the button. -- (void)setRightPanelIsAccessible:(BOOL)rightPanelIsAccessible forViewController:(nonnull UIViewController *)viewController; +- (void)setRightPanelIsAccessible:(BOOL)rightPanelIsAccessible forViewController:(nonnull UIViewController *)viewController updateNavigationButtons:(BOOL)updateNavigationButtons; - (void)hideLeftPanelIfNeededAnimated:(BOOL)animated; - (void)showLeftPanelAnimated:(BOOL)animated; @@ -94,6 +94,12 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) { /// Updates the panels that are used. - (void)setupPanels; +/// Returns if the left panel is staying extended (usually do to screen size threshold) +- (BOOL)leftPanelStaysExtended; + +/// Returns if the right panel is staying extended (usually do to screen size threshold) +- (BOOL)rightPanelStaysExtended; + #pragma mark - Bottom Progress Bar - (void)setBottomProgressBarProgress:(float)progress; diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m index 82594e53..03025617 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m @@ -110,11 +110,11 @@ CGFloat const PanelAnimationDuration = 0.2; } - (nullable NSArray *)additionalLeftButtonsForViewController:(nonnull UIViewController *)viewController { - return viewController.navigationItem.leftBarButtonItems; + return nil; } - (nullable NSArray *)additionalRightButtonsForViewController:(nonnull UIViewController *)viewController { - return viewController.navigationItem.rightBarButtonItems; + return nil; } - (CGFloat)leftPanelExtendedWidth { @@ -234,19 +234,27 @@ CGFloat const PanelAnimationDuration = 0.2; } } +- (BOOL)leftPanelStaysExtended { + MFNumberOfDrawers numberOfDrawers = [self numberOfDrawersShouldShow:self.transitionWidth]; + return [self shouldExtendLeftPanel:numberOfDrawers] && (numberOfDrawers != MFOneDrawer || self.explictlyShowingPanel != self.rightPanel); +} + - (void)setLeftNavigationItemForViewController:(UIViewController * _Nonnull)viewController accessible:(BOOL)accessible extended:(BOOL)extended { NSMutableArray *leftBarButtonItems = [NSMutableArray array]; - NSArray *extraButtons = [self additionalLeftButtonsForViewController:viewController]; - if ((accessible && !extended) && self.leftPanelButton && ![extraButtons containsObject:self.leftPanelButton]) { + if ([viewController.navigationController.viewControllers count] > 1) { + [leftBarButtonItems addObject:self.backButton]; + } + if ((accessible && !extended) && self.leftPanelButton) { [leftBarButtonItems addObject:self.leftPanelButton]; } + NSArray *extraButtons = [self additionalLeftButtonsForViewController:viewController]; if (extraButtons) { [leftBarButtonItems addObjectsFromArray:extraButtons]; } [viewController.navigationItem setLeftBarButtonItems:(leftBarButtonItems.count > 0 ? leftBarButtonItems : nil) animated:!DisableAnimations]; } -- (void)setLeftPanelIsAccessible:(BOOL)leftPanelIsAccessible forViewController:(UIViewController *)viewController { +- (void)setLeftPanelIsAccessible:(BOOL)leftPanelIsAccessible forViewController:(UIViewController *)viewController updateNavigationButtons:(BOOL)updateNavigationButtons { if ([self.leftPanel respondsToSelector:@selector(panelAvailable)]) { self.leftPanelIsAccessible = leftPanelIsAccessible && [self.leftPanel panelAvailable]; } else { @@ -262,8 +270,7 @@ CGFloat const PanelAnimationDuration = 0.2; } else { // Determine if we should show the panel (extended based on width or from explicit action). - MFNumberOfDrawers numberOfDrawers = [self numberOfDrawersShouldShow:self.transitionWidth]; - extended = [self shouldExtendLeftPanel:numberOfDrawers] && (numberOfDrawers != MFOneDrawer || self.explictlyShowingPanel != self.rightPanel); + extended = [self leftPanelStaysExtended]; if (extended || self.explictlyShowingPanel == self.leftPanel) { [self showLeftPanelAnimated:NO explict:NO]; } @@ -272,7 +279,9 @@ CGFloat const PanelAnimationDuration = 0.2; [self.leftPanel resetIconToDefault]; } } - [self setLeftNavigationItemForViewController:viewController accessible:self.leftPanelIsAccessible extended:extended]; + if (updateNavigationButtons) { + [self setLeftNavigationItemForViewController:viewController accessible:self.leftPanelIsAccessible extended:extended]; + } }]; } @@ -407,10 +416,10 @@ CGFloat const PanelAnimationDuration = 0.2; - (void)setRightNavigationItemForViewController:(UIViewController * _Nonnull)viewController accessible:(BOOL)accessible extended:(BOOL)extended { NSMutableArray *navigationItems = [[NSMutableArray alloc] init]; - NSArray *extraButtons = [self additionalRightButtonsForViewController:viewController]; - if ((accessible && !extended) && self.rightPanelButton && ![extraButtons containsObject:self.rightPanelButton]) { + if ((accessible && !extended) && self.rightPanelButton) { [navigationItems addObject:self.rightPanelButton]; } + NSArray *extraButtons = [self additionalRightButtonsForViewController:viewController]; if (extraButtons) { [navigationItems addObjectsFromArray:extraButtons]; } @@ -440,7 +449,12 @@ CGFloat const PanelAnimationDuration = 0.2; } } -- (void)setRightPanelIsAccessible:(BOOL)rightPanelIsAccessible forViewController:(UIViewController *)viewController { +- (BOOL)rightPanelStaysExtended { + MFNumberOfDrawers numberOfDrawers = [self numberOfDrawersShouldShow:self.transitionWidth]; + return [self shouldExtendRightPanel:numberOfDrawers] && (numberOfDrawers != MFOneDrawer || self.explictlyShowingPanel != self.leftPanel); +} + +- (void)setRightPanelIsAccessible:(BOOL)rightPanelIsAccessible forViewController:(UIViewController *)viewController updateNavigationButtons:(BOOL)updateNavigationButtons { if ([self.rightPanel respondsToSelector:@selector(panelAvailable)]) { self.rightPanelIsAccessible = rightPanelIsAccessible && [self.rightPanel panelAvailable]; @@ -458,8 +472,7 @@ CGFloat const PanelAnimationDuration = 0.2; } else { // Determine if we should show the right panel (extended based on width or from explicit action). - MFNumberOfDrawers numberOfDrawers = [self numberOfDrawersShouldShow:self.transitionWidth]; - extended = [self shouldExtendRightPanel:numberOfDrawers] && (numberOfDrawers != MFOneDrawer || self.explictlyShowingPanel != self.leftPanel); + extended = [self rightPanelStaysExtended]; if (extended || self.explictlyShowingPanel == self.rightPanel) { [self showRightPanelAnimated:NO explict:NO]; } @@ -468,7 +481,10 @@ CGFloat const PanelAnimationDuration = 0.2; [self.rightPanel resetIconToDefault]; } } - [self setRightNavigationItemForViewController:viewController accessible:rightPanelIsAccessible extended:extended]; + + if (updateNavigationButtons) { + [self setRightNavigationItemForViewController:viewController accessible:rightPanelIsAccessible extended:extended]; + } }]; } @@ -958,11 +974,11 @@ CGFloat const PanelAnimationDuration = 0.2; self.transitionWidth = @(size.width); void (^animate)(id) = nil; - if (self.leftPanelIsAccessible || self.rightPanelIsAccessible) { +// if (self.leftPanelIsAccessible || self.rightPanelIsAccessible) { animate = ^(id context) { [self resetDrawers]; }; - } +// } [coordinator animateAlongsideTransition:animate completion:^(id _Nonnull context) { self.transitionWidth = nil; @@ -974,11 +990,15 @@ CGFloat const PanelAnimationDuration = 0.2; } - (void)resetDrawers { - [self setLeftPanelIsAccessible:self.leftPanelIsAccessible forViewController:self.navigationItemViewController]; - [self setRightPanelIsAccessible:self.rightPanelIsAccessible forViewController:self.navigationItemViewController]; - - [self.view setNeedsLayout]; - [self.view layoutIfNeeded]; + if ([self.navigationItemViewController respondsToSelector:@selector(splitViewDidReset)]) { + [((UIViewController *)self.navigationItemViewController) splitViewDidReset]; + } else { + [self setLeftPanelIsAccessible:self.leftPanelIsAccessible forViewController:self.navigationItemViewController updateNavigationButtons:YES]; + [self setRightPanelIsAccessible:self.rightPanelIsAccessible forViewController:self.navigationItemViewController updateNavigationButtons:YES]; + + [self.view setNeedsLayout]; + [self.view layoutIfNeeded]; + } } - (UIStatusBarStyle)preferredStatusBarStyle { From a5641738620793bc19429b8082efd2d33c575ab0 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 18 Jun 2020 16:34:33 -0400 Subject: [PATCH 53/80] tab bar fixes --- MVMCoreUI/BaseControllers/ViewController.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index 5ff6c893..3a7bc962 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -8,7 +8,7 @@ import UIKit -@objc open class ViewController: UIViewController, MVMCoreViewControllerProtocol, MVMCoreViewManagerViewControllerProtocol, MoleculeDelegateProtocol, FormHolderProtocol, MVMCoreActionDelegateProtocol, MVMCoreLoadDelegateProtocol, UITextFieldDelegate, UITextViewDelegate, ObservingTextFieldDelegate { +@objc open class ViewController: UIViewController, MVMCoreViewControllerProtocol, MVMCoreViewManagerViewControllerProtocol, MoleculeDelegateProtocol, FormHolderProtocol, MVMCoreActionDelegateProtocol, MVMCoreLoadDelegateProtocol, UITextFieldDelegate, UITextViewDelegate, ObservingTextFieldDelegate, MVMCoreUIDetailViewProtocol { @objc public var pageType: String? @objc public var loadObject: MVMCoreLoadObject? public var pageModel: MVMControllerModelProtocol? @@ -421,6 +421,13 @@ import UIKit open func addMolecules(_ molecules: [ListItemModelProtocol & MoleculeModelProtocol], indexPath: IndexPath, animation: UITableView.RowAnimation) {} open func removeMolecules(_ molecules: [ListItemModelProtocol & MoleculeModelProtocol], animation: UITableView.RowAnimation) {} + // MARK: - MVMCoreUIDetailViewProtocol + + // Reset the navigation state. + public func splitViewDidReset() { + setNavigationController() + } + // MARK: - UITextFieldDelegate (Check if this is still needed) // To Remove TextFields Bug: Keyboard is not dismissing after reaching textfield max length limit open func textFieldShouldReturn(_ textField: UITextField) -> Bool { From fde6e7ed9b22b20fd68c90ea4ab0429c894320a3 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 18 Jun 2020 16:45:23 -0400 Subject: [PATCH 54/80] remove comments --- .../SplitViewController/MVMCoreUISplitViewController.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m index 03025617..2a98a418 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m @@ -974,11 +974,11 @@ CGFloat const PanelAnimationDuration = 0.2; self.transitionWidth = @(size.width); void (^animate)(id) = nil; -// if (self.leftPanelIsAccessible || self.rightPanelIsAccessible) { + if (self.leftPanelIsAccessible || self.rightPanelIsAccessible) { animate = ^(id context) { [self resetDrawers]; }; -// } + } [coordinator animateAlongsideTransition:animate completion:^(id _Nonnull context) { self.transitionWidth = nil; From 57c3ed3c12b2a1d27dc5a753b89e4f6a77e06926 Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Fri, 19 Jun 2020 19:13:25 +0530 Subject: [PATCH 55/80] spaces removed --- MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift | 3 +-- MVMCoreUI/Atomic/Organisms/Carousel.swift | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift index 5103b440..1b9ce0dc 100644 --- a/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift +++ b/MVMCoreUI/Atomic/Molecules/Items/CarouselItemModel.swift @@ -10,8 +10,6 @@ import Foundation @objcMembers public class CarouselItemModel: MoleculeCollectionItemModel, CarouselItemModelProtocol { - public var analyticsData: JSONValueDictionary? - //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- @@ -22,6 +20,7 @@ import Foundation public var peakingUI: Bool? public var peakingArrowColor: Color? + public var analyticsData: JSONValueDictionary? //-------------------------------------------------- // MARK: - Keys diff --git a/MVMCoreUI/Atomic/Organisms/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel.swift index c6166d39..740cdb9a 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel.swift @@ -165,7 +165,6 @@ open class Carousel: View { pageIndex = carouselModel.index pagingView?.currentIndex = carouselModel.index collectionView.reloadData() - // track analyticsData if(!isTrackedAnalytics){ trackSwipeActionAnalyticsforIndex(pageIndex) @@ -305,9 +304,10 @@ open class Carousel: View { cell.accessibilityElementsHidden = true } } + func trackSwipeActionAnalyticsforIndex(_ index : Int){ guard let itemModel = molecules?[index], - let viewControllerObject = delegateObject?.moleculeDelegate as? MVMCoreViewControllerProtocol else { return } + let viewControllerObject = delegateObject?.moleculeDelegate as? MVMCoreViewControllerProtocol else { return } MVMCoreUILoggingHandler.shared()?.defaultLogAction(forController: viewControllerObject, actionInformation: itemModel.toJSON(), additionalData: nil) } } From 1e724cc7ab5f9218f10bca41681814f5874c5c9f Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 19 Jun 2020 16:01:00 -0400 Subject: [PATCH 56/80] update default values --- MVMCoreUI/BaseControllers/ViewController.swift | 2 +- ...VMCoreUISplitViewController+Extension.swift | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index 3a7bc962..6e1b35ff 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -197,7 +197,7 @@ import UIKit navigationItem.leftItemsSupplementBackButton = true // Utilize helper function to set the split view and navigation item state. - MVMCoreUISplitViewController.setSplitViewController(for: viewController, navigationController: navigationController, navigationItemModel: navigationItemModel, leftPanelAccessible: isMasterInitiallyAccessible(), rightPanelAccessible: isSupportInitiallyAccessible(), progress: bottomProgress()) + MVMCoreUISplitViewController.setSplitViewController(for: viewController, navigationController: navigationController, navigationItemModel: navigationItemModel, leftPanelAccessible: isMasterInitiallyAccessible(), rightPanelAccessible: isSupportInitiallyAccessible(), progress: bottomProgress() ?? 0) } // Eventually will be moved to server diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController+Extension.swift b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController+Extension.swift index ed4f931c..bfbe19ac 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController+Extension.swift +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController+Extension.swift @@ -10,8 +10,8 @@ import Foundation public extension MVMCoreUISplitViewController { - /// Convenience function. Sets the navigation and split view properties for the view controller. - static func setSplitViewController(for viewController: UIViewController, navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, leftPanelAccessible: Bool, rightPanelAccessible: Bool, progress: Float? = nil) { + /// Convenience function. Sets the navigation and split view properties for the view controller. Optional parameters use current value if not set. + static func setSplitViewController(for viewController: UIViewController, navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, leftPanelAccessible: Bool? = nil, rightPanelAccessible: Bool? = nil, progress: Float? = nil) { guard let splitView = MVMCoreUISplitViewController.main(), navigationController == splitView.navigationController, navigationController.topViewController == viewController else { @@ -22,22 +22,24 @@ public extension MVMCoreUISplitViewController { } /// Sets the navigation item for the view controller based on the model and splitview controller - func set(for viewController: UIViewController, navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, leftPanelAccessible: Bool, rightPanelAccessible: Bool, progress: Float? = nil) { + func set(for viewController: UIViewController, navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, leftPanelAccessible: Bool? = nil, rightPanelAccessible: Bool? = nil, progress: Float? = nil) { // Setup the panels. - MVMCoreUISession.sharedGlobal()?.splitViewController?.setupPanels() + setupPanels() NavigationController.setNavigationUI(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) - MVMCoreUISplitViewController.main()?.setLeftPanelIsAccessible(leftPanelAccessible, for: viewController, updateNavigationButtons: false) - MVMCoreUISplitViewController.main()?.setRightPanelIsAccessible(rightPanelAccessible, for: viewController, updateNavigationButtons: false) + setLeftPanelIsAccessible(leftPanelAccessible ?? leftPanelIsAccessible, for: viewController, updateNavigationButtons: false) + setRightPanelIsAccessible(rightPanelAccessible ?? rightPanelIsAccessible, for: viewController, updateNavigationButtons: false) setLeftNavigationButtons(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) setRightNavigationButtons(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController) - MVMCoreUISession.sharedGlobal()?.splitViewController?.setNavigationIconColor(navigationItemModel.tintColor.uiColor) + setNavigationIconColor(navigationItemModel.tintColor.uiColor) - setBottomProgressBarProgress(progress ?? 0) + if let progress = progress { + setBottomProgressBarProgress(progress) + } } /// Sets the left navigation items for the view controller based on model and splitview. From e7ce1daa3be8c1e68e0a7372ff302204cfd78b99 Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Sat, 20 Jun 2020 16:27:18 +0530 Subject: [PATCH 57/80] empty multi progress bar fix. If data usage is empty, then empty grey colour bar should be shown. --- MVMCoreUI/Atomic/Atoms/Views/MultiProgress.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/MultiProgress.swift b/MVMCoreUI/Atomic/Atoms/Views/MultiProgress.swift index 2671fc0d..28cb5bf8 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/MultiProgress.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/MultiProgress.swift @@ -63,7 +63,7 @@ import UIKit addSubview(stack) NSLayoutConstraint.constraintPinSubview(toSuperview: stack) stack.backgroundColor = backgroundColor - stack.contentView.backgroundColor = .mvmWhite + stack.contentView.backgroundColor = .mvmCoolGray3 stack.model = StackModel(molecules: [], axis: .horizontal, spacing: 2) stack.stackModel?.horizontalAlignment = .leading From 206017443e4ba3b6c857f9dc886234b9412fb142 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 22 Jun 2020 10:21:27 -0400 Subject: [PATCH 58/80] back button change --- .../NavigationBar/NavigationItemModel.swift | 6 +++--- .../NavigationItemModelProtocol.swift | 2 +- MVMCoreUI/Containers/NavigationController.swift | 16 +++++++++------- .../MVMCoreUISplitViewController+Extension.swift | 14 ++++++++------ 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift b/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift index c0ee897c..d7d677fa 100644 --- a/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift +++ b/MVMCoreUI/Atomic/Molecules/NavigationBar/NavigationItemModel.swift @@ -18,7 +18,7 @@ public class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProt public var backgroundColor: Color? public var tintColor: Color public var line: LineModel? - public var alwaysShowBackButton = false + public var alwaysShowBackButton: Bool? public var backButton: (NavigationButtonModelProtocol & MoleculeModelProtocol)? = NavigationImageButtonModel(with: "nav_back", action: ActionBackModel()) public var additionalLeftButtons: [(NavigationButtonModelProtocol & MoleculeModelProtocol)]? public var additionalRightButtons: [(NavigationButtonModelProtocol & MoleculeModelProtocol)]? @@ -52,7 +52,7 @@ public class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProt backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) ?? Color(uiColor: .white) tintColor = try typeContainer.decodeIfPresent(Color.self, forKey: .tintColor) ?? Color(uiColor: .black) line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line) ?? LineModel(type: .standard) - alwaysShowBackButton = try typeContainer.decodeIfPresent(Bool.self, forKey: .alwaysShowBackButton) ?? false + alwaysShowBackButton = try typeContainer.decodeIfPresent(Bool.self, forKey: .alwaysShowBackButton) if let backButton: (NavigationButtonModelProtocol & MoleculeModelProtocol) = try typeContainer.decodeModelIfPresent(codingKey: .backButton) { self.backButton = backButton } @@ -68,7 +68,7 @@ public class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProt try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encode(tintColor, forKey: .tintColor) try container.encodeIfPresent(line, forKey: .line) - try container.encode(alwaysShowBackButton, forKey: .alwaysShowBackButton) + try container.encodeIfPresent(alwaysShowBackButton, forKey: .alwaysShowBackButton) try container.encodeModelIfPresent(backButton, forKey: .backButton) try container.encodeModelsIfPresent(additionalLeftButtons, forKey: .additionalLeftButtons) try container.encodeModelsIfPresent(additionalRightButtons, forKey: .additionalRightButtons) diff --git a/MVMCoreUI/Atomic/Protocols/ModelProtocols/NavigationItemModelProtocol.swift b/MVMCoreUI/Atomic/Protocols/ModelProtocols/NavigationItemModelProtocol.swift index 30db2aa6..084509e0 100644 --- a/MVMCoreUI/Atomic/Protocols/ModelProtocols/NavigationItemModelProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/ModelProtocols/NavigationItemModelProtocol.swift @@ -14,7 +14,7 @@ public protocol NavigationItemModelProtocol { var backgroundColor: Color? { get set } var tintColor: Color { get set } var line: LineModel? { get set } - var alwaysShowBackButton: Bool { get set } + var alwaysShowBackButton: Bool? { get set } var backButton: (NavigationButtonModelProtocol & MoleculeModelProtocol)? { get set } var additionalLeftButtons: [(NavigationButtonModelProtocol & MoleculeModelProtocol)]? { get set } var additionalRightButtons: [(NavigationButtonModelProtocol & MoleculeModelProtocol)]? { get set } diff --git a/MVMCoreUI/Containers/NavigationController.swift b/MVMCoreUI/Containers/NavigationController.swift index 12d70634..2803792f 100644 --- a/MVMCoreUI/Containers/NavigationController.swift +++ b/MVMCoreUI/Containers/NavigationController.swift @@ -47,13 +47,15 @@ import UIKit public static func setNavigationButtons(navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, viewController: UIViewController) { let delegate = (viewController as? MVMCoreViewControllerProtocol)?.delegateObject?() as? MVMCoreUIDelegateObject var leftItems: [UIBarButtonItem] = [] - if let backButtonModel = navigationItemModel.backButton, - navigationController.viewControllers.count > 1 || navigationItemModel.alwaysShowBackButton { - leftItems.append(backButtonModel.createNavigationItemButton(delegateObject: delegate, additionalData: nil)) - } - if let leftItemModels = navigationItemModel.additionalLeftButtons { - for item in leftItemModels { - leftItems.append(item.createNavigationItemButton(delegateObject: delegate, additionalData: nil)) + if navigationItemModel.alwaysShowBackButton != false { + if let backButtonModel = navigationItemModel.backButton, + navigationController.viewControllers.count > 1 || navigationItemModel.alwaysShowBackButton ?? false { + leftItems.append(backButtonModel.createNavigationItemButton(delegateObject: delegate, additionalData: nil)) + } + if let leftItemModels = navigationItemModel.additionalLeftButtons { + for item in leftItemModels { + leftItems.append(item.createNavigationItemButton(delegateObject: delegate, additionalData: nil)) + } } } viewController.navigationItem.leftBarButtonItems = leftItems.count > 0 ? leftItems : nil diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController+Extension.swift b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController+Extension.swift index bfbe19ac..e62efa29 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController+Extension.swift +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController+Extension.swift @@ -48,13 +48,15 @@ public extension MVMCoreUISplitViewController { let delegate = (viewController as? MVMCoreViewControllerProtocol)?.delegateObject?() as? MVMCoreUIDelegateObject // Add back button first. - if let backButtonModel = navigationItemModel?.backButton { - if navigationController.viewControllers.count > 1 || navigationItemModel!.alwaysShowBackButton { - leftItems.append(backButtonModel.createNavigationItemButton(delegateObject: delegate, additionalData: nil)) + if navigationItemModel?.alwaysShowBackButton != false { + if let backButtonModel = navigationItemModel?.backButton { + if navigationController.viewControllers.count > 1 || navigationItemModel!.alwaysShowBackButton ?? false { + leftItems.append(backButtonModel.createNavigationItemButton(delegateObject: delegate, additionalData: nil)) + } + } else if let backButton = backButton, + navigationController.viewControllers.count > 1 { + leftItems.append(backButton) } - } else if let backButton = backButton, - navigationController.viewControllers.count > 1 { - leftItems.append(backButton) } // Add the panel button after the back button. From b3a9fcb1ab816e822ca154d6e65ece63f30b52e9 Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Mon, 22 Jun 2020 21:47:23 +0530 Subject: [PATCH 59/80] added review feedback --- MVMCoreUI/Atomic/Atoms/Views/MultiProgress.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/MultiProgress.swift b/MVMCoreUI/Atomic/Atoms/Views/MultiProgress.swift index 28cb5bf8..945229c7 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/MultiProgress.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/MultiProgress.swift @@ -63,7 +63,7 @@ import UIKit addSubview(stack) NSLayoutConstraint.constraintPinSubview(toSuperview: stack) stack.backgroundColor = backgroundColor - stack.contentView.backgroundColor = .mvmCoolGray3 + stack.contentView.backgroundColor = .clear stack.model = StackModel(molecules: [], axis: .horizontal, spacing: 2) stack.stackModel?.horizontalAlignment = .leading @@ -111,7 +111,6 @@ import UIKit roundedCorners = multiProgressModel.roundedCorners ?? false thicknessConstraint?.constant = multiProgressModel.thickness ?? defaultHeight - stack.model?.backgroundColor = model.backgroundColor set(with: multiProgressModel.progressList, delegateObject, additionalData) } From 7c48a25832208ab5d12f3ae190f1670a5a258617 Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Mon, 22 Jun 2020 22:13:32 +0530 Subject: [PATCH 60/80] removed logic for tracking for first time --- MVMCoreUI/Atomic/Organisms/Carousel.swift | 7 ------- .../ModelProtocols/CarouselItemModelProtocol.swift | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/MVMCoreUI/Atomic/Organisms/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel.swift index 740cdb9a..808c370e 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel.swift @@ -68,8 +68,6 @@ open class Carousel: View { private var size: CGFloat? - private var isTrackedAnalytics: Bool = false - // Updates the model and index. public func updateModelIndex() { (model as? CarouselModel)?.index = pageIndex @@ -165,11 +163,6 @@ open class Carousel: View { pageIndex = carouselModel.index pagingView?.currentIndex = carouselModel.index collectionView.reloadData() - // track analyticsData - if(!isTrackedAnalytics){ - trackSwipeActionAnalyticsforIndex(pageIndex) - isTrackedAnalytics = true - } } //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift b/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift index 3501ce42..c2ade02d 100644 --- a/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/ModelProtocols/CarouselItemModelProtocol.swift @@ -16,6 +16,6 @@ public extension CarouselItemModelProtocol { var analyticsData: JSONValueDictionary? { get { return nil } - set{ analyticsData = newValue } + set { analyticsData = newValue } } } From 65fcdb8be06437971a28175bec9fa7dcdbc6ce9b Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 23 Jun 2020 11:06:38 -0400 Subject: [PATCH 61/80] minor organizing --- MVMCoreUI.xcodeproj/project.pbxproj | 32 ++++++++++++++----- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 2 +- .../Headers/{ => H1}/HeadersH1Button.swift | 2 +- .../{ => H1}/HeadersH1ButtonModel.swift | 0 .../Headers/{ => H2}/HeadersH2Buttons.swift | 0 .../{ => H2}/HeadersH2ButtonsModel.swift | 0 .../{ => H2}/HeadersH2NoButtonsBodyText.swift | 0 .../HeadersH2NoButtonsBodyTextModel.swift | 0 .../{ => H2}/HeadersH2TinyButton.swift | 0 .../{ => H2}/HeadersH2TinyButtonModel.swift | 0 10 files changed, 26 insertions(+), 10 deletions(-) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{ => H1}/HeadersH1Button.swift (97%) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{ => H1}/HeadersH1ButtonModel.swift (100%) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{ => H2}/HeadersH2Buttons.swift (100%) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{ => H2}/HeadersH2ButtonsModel.swift (100%) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{ => H2}/HeadersH2NoButtonsBodyText.swift (100%) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{ => H2}/HeadersH2NoButtonsBodyTextModel.swift (100%) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{ => H2}/HeadersH2TinyButton.swift (100%) rename MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/{ => H2}/HeadersH2TinyButtonModel.swift (100%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 3564829c..7f1edb59 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -1040,14 +1040,8 @@ 5206F150241144A900658DC5 /* Headers */ = { isa = PBXGroup; children = ( - AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */, - AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */, - AA26850D244840C300CE34CC /* HeadersH2TinyButtonModel.swift */, - AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */, - AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */, - AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */, - AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */, - AA104AC624472DB0004D2810 /* HeadersH1Button.swift */, + D287955224A2504C0056BF75 /* H1 */, + D287955324A250550056BF75 /* H2 */, ); path = Headers; sourceTree = ""; @@ -1493,6 +1487,28 @@ path = Selectors; sourceTree = ""; }; + D287955224A2504C0056BF75 /* H1 */ = { + isa = PBXGroup; + children = ( + AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */, + AA104AC624472DB0004D2810 /* HeadersH1Button.swift */, + ); + path = H1; + sourceTree = ""; + }; + D287955324A250550056BF75 /* H2 */ = { + isa = PBXGroup; + children = ( + AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */, + AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */, + AA26850D244840C300CE34CC /* HeadersH2TinyButtonModel.swift */, + AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */, + AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */, + AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */, + ); + path = H2; + sourceTree = ""; + }; D29DF0C221E404D4003B2FB9 = { isa = PBXGroup; children = ( diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index f2a1901a..c8677ba1 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -204,10 +204,10 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnDataUsageDivider.self, viewModelClass: ListThreeColumnDataUsageDividerModel.self) // Designed Headers + MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1Button.self, viewModelClass: HeadersH1ButtonModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2TinyButton.self, viewModelClass: HeadersH2TinyButtonModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2Buttons.self, viewModelClass: HeadersH2ButtonsModel.self) - MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1Button.self, viewModelClass: HeadersH1ButtonModel.self) // Device Items MoleculeObjectMapping.shared()?.register(viewClass: ListDeviceComplexButtonMedium.self, viewModelClass: ListDeviceComplexButtonMediumModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1Button.swift similarity index 97% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1Button.swift index eeddf714..d41b9022 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1Button.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1Button.swift @@ -20,7 +20,7 @@ import Foundation // MARK: - Initializers //------------------------------------------------------- public override init(frame: CGRect) { - stack = Stack.createStack(with: [headlineBody, buttons], spacing: PaddingVerticalWhiteGrayView) + stack = Stack.createStack(with: [headlineBody, buttons], spacing: Padding.Eighteen) super.init(frame: frame) } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1ButtonModel.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH1ButtonModel.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1ButtonModel.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2Buttons.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2Buttons.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2Buttons.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2Buttons.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2ButtonsModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2ButtonsModel.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyText.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyText.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyText.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyTextModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2NoButtonsBodyTextModel.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2TinyButton.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButton.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2TinyButton.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButton.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2TinyButtonModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift similarity index 100% rename from MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2TinyButtonModel.swift rename to MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift From a5e6941c30d6c99c44164f79d4e5482d5ece641e Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 23 Jun 2020 12:12:02 -0400 Subject: [PATCH 62/80] re-arrage code --- .../Headers/H2/HeadersH2PricingTwoRows.swift | 121 ++++++++++++++++++ .../H2/HeadersH2PricingTwoRowsModel.swift | 89 +++++++++++++ 2 files changed, 210 insertions(+) create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRows.swift create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRows.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRows.swift new file mode 100644 index 00000000..12097880 --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRows.swift @@ -0,0 +1,121 @@ +// +// HeadersH2PricingTwoRows.swift +// MVMCoreUI +// +// Created by Lekshmi S on 16/06/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class HeadersH2PricingTwoRows: HeaderView { + //-------------------------------------------------- + // MARK: - Outlets + //-------------------------------------------------- + public let headline = Label(fontStyle: .RegularTitleLarge) + public let body = Label(fontStyle: .RegularMicro) + public let subBody = Label(fontStyle: .RegularMicro) + public let body2 = Label(fontStyle: .RegularMicro) + public let subBody2 = Label(fontStyle: .RegularMicro) + public let body3 = Label(fontStyle: .RegularMicro) + public let subBody3 = Label(fontStyle: .RegularMicro) + public let verticalLine1 = Line() + public let verticalLine2 = Line() + public let verticalStack1: Stack + public let verticalStack2: Stack + public let verticalStack3: Stack + public let horizontalStack: Stack + public let stack: Stack + + //------------------------------------------------------- + // MARK: - Initializers + //------------------------------------------------------- + public override init(frame: CGRect) { + verticalStack1 = Stack.createStack(with: [body, subBody], spacing: 0) + verticalStack2 = Stack.createStack(with: [body2, subBody2], spacing: 0) + verticalStack3 = Stack.createStack(with: [body3, subBody3], spacing: 0) + horizontalStack = Stack.createStack(with: [(view: verticalStack1, model: StackItemModel(percent: 29, verticalAlignment: .top)), (view: verticalLine1, model: StackItemModel(verticalAlignment: .top)), + (view: verticalStack2, model: StackItemModel(horizontalAlignment: .leading, verticalAlignment: .top)), + (view: verticalLine2, model: StackItemModel(verticalAlignment: .top)), + (view: verticalStack3, model: StackItemModel(percent: 32, verticalAlignment: .top))], + axis: .horizontal) + stack = Stack.createStack(with: [headline, horizontalStack], spacing: 8) + super.init(frame: frame) + } + + public required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + //------------------------------------------------------- + // MARK: - Lifecycle + //------------------------------------------------------- + open override func setupView() { + super.setupView() + setDefaults() + body.numberOfLines = 1 + body.lineBreakMode = .byTruncatingTail + body2.numberOfLines = 1 + body2.lineBreakMode = .byTruncatingTail + body3.numberOfLines = 1 + body3.lineBreakMode = .byTruncatingTail + + verticalLine1.widthConstraint?.isActive = true + verticalLine1.backgroundColor = .mvmBlack + verticalLine2.widthConstraint?.isActive = true + verticalLine2.backgroundColor = .mvmBlack + + addMolecule(stack) + stack.restack() + verticalStack1.restack() + verticalStack2.restack() + verticalStack3.restack() + horizontalStack.restack() + setLineHeight() + } + + open func setDefaults() { + headline.setFontStyle(.BoldTitleLarge) + body.setFontStyle(.RegularMicro) + subBody.setFontStyle(.RegularMicro) + body2.setFontStyle(.RegularMicro) + subBody2.setFontStyle(.RegularMicro) + body3.setFontStyle(.RegularMicro) + subBody3.setFontStyle(.RegularMicro) + subBody.textColor = .mvmCoolGray6 + subBody2.textColor = .mvmCoolGray6 + subBody3.textColor = .mvmCoolGray6 + } + + open func setLineHeight() { + verticalLine1.heightConstraint?.isActive = false + verticalLine1.heightConstraint = verticalLine1.heightAnchor.constraint(equalTo: body2.heightAnchor, multiplier: 1) + verticalLine1.heightConstraint?.isActive = true + + verticalLine2.heightConstraint?.isActive = false + verticalLine2.heightConstraint = verticalLine2.heightAnchor.constraint(equalTo: body3.heightAnchor, multiplier: 1) + verticalLine2.heightConstraint?.isActive = true + } + + //---------------------------------------------------- + // MARK: - Molecule + //------------------------------------------------------ + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { + super.set(with: model, delegateObject, additionalData) + guard let model = model as? HeadersH2PricingTwoRowsModel else { return } + headline.set(with: model.headline, delegateObject, additionalData) + verticalStack1.updateContainedMolecules(with: [model.body, model.subBody], delegateObject, additionalData) + verticalStack2.updateContainedMolecules(with: [model.body2, model.subBody2], delegateObject, additionalData) + verticalStack3.updateContainedMolecules(with: [model.body3, model.subBody3], delegateObject, additionalData) + setLineHeight() + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 121 + } + + open override func reset() { + super.reset() + setDefaults() + } +} diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift new file mode 100644 index 00000000..219f539f --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift @@ -0,0 +1,89 @@ +// +// HeadersH2PricingTwoRowsModel.swift +// MVMCoreUI +// +// Created by Lekshmi S on 16/06/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class HeadersH2PricingTwoRowsModel: HeaderModel, MoleculeModelProtocol { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + public static var identifier: String = "headerH2TwoRows" + public var headline: LabelModel + public var body: LabelModel + public var subBody: LabelModel? + public var body2: LabelModel + public var subBody2: LabelModel? + public var body3: LabelModel + public var subBody3: LabelModel? + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public init(headline: LabelModel, body: LabelModel, subBody: LabelModel? = nil, body2: LabelModel, subBody2: LabelModel? = nil, body3: LabelModel, subBody3: LabelModel? = nil) { + self.headline = headline + self.body = body + self.subBody = subBody + self.body2 = body2 + self.subBody2 = subBody2 + self.body3 = body3 + self.subBody3 = subBody3 + super.init() + } + + //-------------------------------------------------- + // MARK: - Methods + //-------------------------------------------------- + public override func setDefaults() { + super.setDefaults() + subBody?.attributes = [LabelAttributeStrikeThroughModel(0, subBody?.text.count ?? 0)] + subBody2?.attributes = [LabelAttributeStrikeThroughModel(0, subBody2?.text.count ?? 0)] + subBody3?.attributes = [LabelAttributeStrikeThroughModel(0, subBody3?.text.count ?? 0)] + } + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + private enum CodingKeys: String, CodingKey { + case moleculeName + case headline + case body + case subBody + case body2 + case subBody2 + case body3 + case subBody3 + } + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + headline = try typeContainer.decode(LabelModel.self, forKey: .headline) + body = try typeContainer.decode(LabelModel.self, forKey: .body) + subBody = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .subBody) + body2 = try typeContainer.decode(LabelModel.self, forKey: .body2) + subBody2 = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .subBody2) + body3 = try typeContainer.decode(LabelModel.self, forKey: .body3) + subBody3 = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .subBody3) + try super.init(from: decoder) + } + + public override func encode(to encoder: Encoder) throws { + try super.encode(to: encoder) + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encode(headline, forKey: .headline) + try container.encode(body, forKey: .body) + try container.encodeIfPresent(subBody, forKey: .subBody) + try container.encode(body2, forKey: .body2) + try container.encodeIfPresent(subBody2, forKey: .subBody2) + try container.encode(body3, forKey: .body3) + try container.encodeIfPresent(subBody3, forKey: .subBody3) + } +} From 384158e8556dce41f6a2b635f070044831ceb8c6 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 23 Jun 2020 12:13:19 -0400 Subject: [PATCH 63/80] align --- MVMCoreUI.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index afac04c7..d483d10c 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -1511,7 +1511,7 @@ AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */, AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */, AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */, - AA633B3024989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift */, + AA633B3024989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift */, AA633B3224989ED500731E80 /* HeadersH2PricingTwoRows.swift */, ); path = H2; From 3add9702c68505f55b3bb783c5d172954dd464e8 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 23 Jun 2020 12:14:10 -0400 Subject: [PATCH 64/80] move files --- .../Headers/HeadersH2PricingTwoRows.swift | 95 ------------------- 1 file changed, 95 deletions(-) delete mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRows.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRows.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRows.swift deleted file mode 100644 index 9d861fe2..00000000 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRows.swift +++ /dev/null @@ -1,95 +0,0 @@ -// -// HeadersH2PricingTwoRows.swift -// MVMCoreUI -// -// Created by Lekshmi S on 16/06/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation - -@objcMembers open class HeadersH2PricingTwoRows: HeaderView { - //-------------------------------------------------- - // MARK: - Outlets - //-------------------------------------------------- - public let headline = Label(fontStyle: .H2) - public let body = Label(fontStyle: .B2) - public let subBody = Label(fontStyle: .B3) - public let body2 = Label(fontStyle: .B2) - public let subBody2 = Label(fontStyle: .B3) - public let body3 = Label(fontStyle: .B2) - public let subBody3 = Label(fontStyle: .B3) - public let verticalLine1 = Line() - public let verticalLine2 = Line() - public let verticalStack1: Stack - public let verticalStack2: Stack - public let verticalStack3: Stack - public let horizontalStack: Stack - public let stack: Stack - - //------------------------------------------------------- - // MARK: - Initializers - //------------------------------------------------------- - public override init(frame: CGRect) { - verticalStack1 = Stack.createStack(with: [body, subBody], spacing: 0) - verticalStack2 = Stack.createStack(with: [body2, subBody2], spacing: 0) - verticalStack3 = Stack.createStack(with: [body3, subBody3], spacing: 0) - horizontalStack = Stack.createStack(with: [(view: verticalStack1, model: StackItemModel(percent: 29, horizontalAlignment: .leading, verticalAlignment: .top)), (view: verticalLine1, model: StackItemModel(percent: 2, verticalAlignment: .top)), - (view: verticalStack2, model: StackItemModel(percent: 33, horizontalAlignment: .center, verticalAlignment: .top)), - (view: verticalLine2, model: StackItemModel(percent: 2, verticalAlignment: .top)), - (view: verticalStack3, model: StackItemModel(percent: 34, horizontalAlignment: .center, verticalAlignment: .top))], - axis: .horizontal) - stack = Stack.createStack(with: [headline, horizontalStack], spacing: 8) - super.init(frame: frame) - } - - public required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - //------------------------------------------------------- - // MARK: - Lifecycle - //------------------------------------------------------- - open override func setupView() { - super.setupView() - verticalLine1.widthConstraint?.isActive = true - verticalLine1.backgroundColor = .mvmBlack - verticalLine1.heightConstraint?.constant = 13 - verticalLine2.widthConstraint?.isActive = true - verticalLine2.backgroundColor = .mvmBlack - verticalLine2.heightConstraint?.constant = 13 - addMolecule(stack) - stack.restack() - verticalStack1.restack() - verticalStack2.restack() - verticalStack3.restack() - horizontalStack.restack() - } - - //---------------------------------------------------- - // MARK: - Molecule - //------------------------------------------------------ - open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { - super.set(with: model, delegateObject, additionalData) - guard let model = model as? HeadersH2PricingTwoRowsModel else { return } - headline.set(with: model.headline, delegateObject, additionalData) - verticalStack1.updateContainedMolecules(with: [model.body, model.subBody], delegateObject, additionalData) - verticalStack2.updateContainedMolecules(with: [model.body2, model.subBody2], delegateObject, additionalData) - verticalStack3.updateContainedMolecules(with: [model.body3, model.subBody3], delegateObject, additionalData) - } - - open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { - return 121 - } - - open override func reset() { - super.reset() - headline.setFontStyle(.H2) - body.setFontStyle(.B2) - subBody.setFontStyle(.B3) - body2.setFontStyle(.B2) - subBody2.setFontStyle(.B3) - body3.setFontStyle(.B2) - subBody3.setFontStyle(.B3) - } -} From 17af164cd9a6c2b52e841ed39cb16cefac46854b Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 23 Jun 2020 12:14:37 -0400 Subject: [PATCH 65/80] move files --- .../HeadersH2PricingTwoRowsModel.swift | 90 ------------------- 1 file changed, 90 deletions(-) delete mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRowsModel.swift diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRowsModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRowsModel.swift deleted file mode 100644 index 6991bf03..00000000 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2PricingTwoRowsModel.swift +++ /dev/null @@ -1,90 +0,0 @@ -// -// HeadersH2PricingTwoRowsModel.swift -// MVMCoreUI -// -// Created by Lekshmi S on 16/06/20. -// Copyright © 2020 Verizon Wireless. All rights reserved. -// - -import Foundation - -public class HeadersH2PricingTwoRowsModel: HeaderModel, MoleculeModelProtocol { - //-------------------------------------------------- - // MARK: - Properties - //-------------------------------------------------- - public static var identifier: String = "headerH2TwoRows" - public var headline: LabelModel - public var body: LabelModel - public var subBody: LabelModel? - public var body2: LabelModel - public var subBody2: LabelModel? - public var body3: LabelModel - public var subBody3: LabelModel? - - //-------------------------------------------------- - // MARK: - Initializer - //-------------------------------------------------- - public init(headline: LabelModel, body: LabelModel, subBody: LabelModel? = nil, body2: LabelModel, subBody2: LabelModel? = nil, body3: LabelModel, subBody3: LabelModel? = nil) { - self.headline = headline - self.body = body - self.subBody = subBody - self.body2 = body2 - self.subBody2 = subBody2 - self.body3 = body3 - self.subBody3 = subBody3 - super.init() - } - - //-------------------------------------------------- - // MARK: - Methods - //-------------------------------------------------- - public override func setDefaults() { - super.setDefaults() - body.hero = 0 - subBody?.attributes = [LabelAttributeStrikeThroughModel(0, subBody?.text.count ?? 0)] - subBody2?.attributes = [LabelAttributeStrikeThroughModel(0, subBody2?.text.count ?? 0)] - subBody3?.attributes = [LabelAttributeStrikeThroughModel(0, subBody3?.text.count ?? 0)] - } - - //-------------------------------------------------- - // MARK: - Keys - //-------------------------------------------------- - private enum CodingKeys: String, CodingKey { - case moleculeName - case headline - case body - case subBody - case body2 - case subBody2 - case body3 - case subBody3 - } - - //-------------------------------------------------- - // MARK: - Codec - //-------------------------------------------------- - required public init(from decoder: Decoder) throws { - let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - headline = try typeContainer.decode(LabelModel.self, forKey: .headline) - body = try typeContainer.decode(LabelModel.self, forKey: .body) - subBody = try typeContainer.decode(LabelModel.self, forKey: .subBody) - body2 = try typeContainer.decode(LabelModel.self, forKey: .body2) - subBody2 = try typeContainer.decode(LabelModel.self, forKey: .subBody2) - body3 = try typeContainer.decode(LabelModel.self, forKey: .body3) - subBody3 = try typeContainer.decode(LabelModel.self, forKey: .subBody3) - try super.init(from: decoder) - } - - public override func encode(to encoder: Encoder) throws { - try super.encode(to: encoder) - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode(moleculeName, forKey: .moleculeName) - try container.encode(headline, forKey: .headline) - try container.encode(body, forKey: .body) - try container.encode(subBody, forKey: .subBody) - try container.encode(body2, forKey: .body2) - try container.encode(subBody2, forKey: .subBody2) - try container.encode(body3, forKey: .body3) - try container.encode(subBody3, forKey: .subBody3) - } -} From 57dcdfea9cb0a5a6d2b4bb00e4d81c335451226a Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 23 Jun 2020 13:17:51 -0400 Subject: [PATCH 66/80] only allocate stack once. --- .../Headers/H1/HeadersH1LandingPageHeader.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1LandingPageHeader.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1LandingPageHeader.swift index bd37ed78..c78ada3f 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1LandingPageHeader.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1LandingPageHeader.swift @@ -18,7 +18,7 @@ import Foundation public let body = Label(fontStyle: .RegularBodySmall) public let link = Link() public let buttons = TwoButtonView(frame: .zero) - public var stack = Stack(frame: .zero) + public var stack: Stack! //-------------------------------------------------- // MARK: - Constants @@ -33,8 +33,12 @@ import Foundation //------------------------------------------------------- open override func setupView() { super.setupView() - stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), - (view: headline2, model: StackItemModel(spacing: spacingBetweenHeadlineHeadline2, horizontalAlignment: .leading)), (view: subHeadline, model: StackItemModel(spacing: spacingBetweenHeadline2subHeadline, horizontalAlignment: .leading)), (view: body, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: link, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), (view: buttons, model: StackItemModel(spacing: spacingBetweenLinkButtons))], axis: .vertical) + stack = Stack.createStack(with: [(view: headline, model: StackItemModel()), + (view: headline2, model: StackItemModel(spacing: spacingBetweenHeadlineHeadline2)), + (view: subHeadline, model: StackItemModel(spacing: spacingBetweenHeadline2subHeadline)), + (view: body, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink)), + (view: link, model: StackItemModel(spacing: spacingBetweenSubHeadlineBodyLink, horizontalAlignment: .leading)), + (view: buttons, model: StackItemModel(spacing: spacingBetweenLinkButtons))]) addMolecule(stack) stack.restack() } From b1c1734a19890e05d67ae2367c8054ba0679f0d3 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 24 Jun 2020 12:57:04 +0530 Subject: [PATCH 67/80] 21518(iOS - Headers - H2 - Link) initial commit. Added model and molecule class files. --- MVMCoreUI.xcodeproj/project.pbxproj | 12 +++- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 + .../Headers/H2/HeadersH2Link.swift | 59 ++++++++++++++++ .../Headers/H2/HeadersH2LinkModel.swift | 68 +++++++++++++++++++ 4 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2Link.swift create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 6c80ccd2..43982c8b 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -211,6 +211,8 @@ AA633B3324989ED500731E80 /* HeadersH2PricingTwoRows.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA633B3224989ED500731E80 /* HeadersH2PricingTwoRows.swift */; }; AA69AAF62445BF5700AF3D3B /* ListLeftVariableCheckboxBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA69AAF52445BF5700AF3D3B /* ListLeftVariableCheckboxBodyText.swift */; }; AA69AAF82445BF6800AF3D3B /* ListLeftVariableCheckboxBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA69AAF72445BF6800AF3D3B /* ListLeftVariableCheckboxBodyTextModel.swift */; }; + AA71AD3E24A32FCE00ACA76F /* HeadersH2LinkModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA71AD3D24A32FCE00ACA76F /* HeadersH2LinkModel.swift */; }; + AA71AD4024A32FE700ACA76F /* HeadersH2Link.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA71AD3F24A32FE700ACA76F /* HeadersH2Link.swift */; }; AA7F32AB246C0F7900C965BA /* ListLeftVariableRadioButtonAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA7F32AA246C0F7900C965BA /* ListLeftVariableRadioButtonAllTextAndLinksModel.swift */; }; AA7F32AD246C0F8C00C965BA /* ListLeftVariableRadioButtonAllTextAndLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA7F32AC246C0F8C00C965BA /* ListLeftVariableRadioButtonAllTextAndLinks.swift */; }; AA85236C244435A20059CC1E /* RadioSwatchCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA85236B244435A20059CC1E /* RadioSwatchCollectionViewCell.swift */; }; @@ -665,6 +667,8 @@ AA633B3224989ED500731E80 /* HeadersH2PricingTwoRows.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2PricingTwoRows.swift; sourceTree = ""; }; AA69AAF52445BF5700AF3D3B /* ListLeftVariableCheckboxBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableCheckboxBodyText.swift; sourceTree = ""; }; AA69AAF72445BF6800AF3D3B /* ListLeftVariableCheckboxBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableCheckboxBodyTextModel.swift; sourceTree = ""; }; + AA71AD3D24A32FCE00ACA76F /* HeadersH2LinkModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2LinkModel.swift; sourceTree = ""; }; + AA71AD3F24A32FE700ACA76F /* HeadersH2Link.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2Link.swift; sourceTree = ""; }; AA7F32AA246C0F7900C965BA /* ListLeftVariableRadioButtonAllTextAndLinksModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableRadioButtonAllTextAndLinksModel.swift; sourceTree = ""; }; AA7F32AC246C0F8C00C965BA /* ListLeftVariableRadioButtonAllTextAndLinks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableRadioButtonAllTextAndLinks.swift; sourceTree = ""; }; AA85236B244435A20059CC1E /* RadioSwatchCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioSwatchCollectionViewCell.swift; sourceTree = ""; }; @@ -1502,7 +1506,7 @@ children = ( AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */, AA104AC624472DB0004D2810 /* HeadersH1Button.swift */, - AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */, + AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */, AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */, ); path = H1; @@ -1517,8 +1521,10 @@ AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */, AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */, AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */, - AA633B3024989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift */, + AA633B3024989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift */, AA633B3224989ED500731E80 /* HeadersH2PricingTwoRows.swift */, + AA71AD3D24A32FCE00ACA76F /* HeadersH2LinkModel.swift */, + AA71AD3F24A32FE700ACA76F /* HeadersH2Link.swift */, ); path = H2; sourceTree = ""; @@ -2143,6 +2149,7 @@ 01004F3022721C3800991ECC /* RadioButton.swift in Sources */, D268C70E238C22D7007F2C1C /* DropDownFilterTableViewCell.swift in Sources */, D236E5B7242007C500C38625 /* MVMControllerModelProtocol.swift in Sources */, + AA71AD4024A32FE700ACA76F /* HeadersH2Link.swift in Sources */, D29DF11721E6805F003B2FB9 /* UIColor+MFConvenience.m in Sources */, D2B18B7F2360913400A9AEDC /* Control.swift in Sources */, D253BB8A24574CC5002DE544 /* StackModel.swift in Sources */, @@ -2398,6 +2405,7 @@ 8D070BB2241B56AD0099AC56 /* ListRightVariableTotalData.swift in Sources */, D264FAA5243F66A500D98315 /* CollectionTemplateItemProtocol.swift in Sources */, D29DF11D21E684A9003B2FB9 /* MVMCoreUISplitViewController.m in Sources */, + AA71AD3E24A32FCE00ACA76F /* HeadersH2LinkModel.swift in Sources */, 8DD1E36E243B3CFB00D8F2DF /* ListThreeColumnInternationalDataModel.swift in Sources */, D243859923A16B1800332775 /* Container.swift in Sources */, D2C521A923EDE79E00CA2634 /* ViewController.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index c6bb77bb..b5209bfb 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -210,6 +210,7 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2TinyButton.self, viewModelClass: HeadersH2TinyButtonModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2Buttons.self, viewModelClass: HeadersH2ButtonsModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2PricingTwoRows.self, viewModelClass: HeadersH2PricingTwoRowsModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2Link.self, viewModelClass: HeadersH2LinkModel.self) // Device Items MoleculeObjectMapping.shared()?.register(viewClass: ListDeviceComplexButtonMedium.self, viewModelClass: ListDeviceComplexButtonMediumModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2Link.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2Link.swift new file mode 100644 index 00000000..4b0334e7 --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2Link.swift @@ -0,0 +1,59 @@ +// +// HeadersH2Link.swift +// MVMCoreUI +// +// Created by Lekshmi S on 24/06/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class HeadersH2Link: HeaderView { + //-------------------------------------------------- + // MARK: - Outlets + //-------------------------------------------------- + public let headlineBody = HeadlineBody() + public let link = Link() + public let stack: Stack + + //------------------------------------------------------- + // MARK: - Initializers + //------------------------------------------------------- + public override init(frame: CGRect) { + stack = Stack.createStack(with: [headlineBody, link], spacing: PaddingHorizontalBetweenRelatedItems) + super.init(frame: frame) + } + + public required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + //------------------------------------------------------- + // MARK: - Lifecycle + //------------------------------------------------------- + open override func setupView() { + super.setupView() + headlineBody.stylePageHeader() + addMolecule(stack) + stack.restack() + } + + //---------------------------------------------------- + // MARK: - Molecule + //------------------------------------------------------ + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { + super.set(with: model, delegateObject, additionalData) + guard let model = model as? HeadersH2LinkModel else { return } + headlineBody.set(with: model.headlineBody, delegateObject, additionalData) + link.set(with: model.link, delegateObject, additionalData) + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 121 + } + + open override func reset() { + super.reset() + headlineBody.stylePageHeader() + } +} diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift new file mode 100644 index 00000000..5793eedf --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift @@ -0,0 +1,68 @@ +// +// HeadersH2LinkModel.swift +// MVMCoreUI +// +// Created by Lekshmi S on 24/06/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class HeadersH2LinkModel: HeaderModel, MoleculeModelProtocol { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + + public static var identifier: String = "headerH2Link" + public var headlineBody: HeadlineBodyModel + public var link: LinkModel + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(headlineBody: HeadlineBodyModel, link: LinkModel) { + self.headlineBody = headlineBody + self.link = link + super.init() + } + + //-------------------------------------------------- + // MARK: - Methods + //-------------------------------------------------- + + public override func setDefaults() { + super.setDefaults() + topPadding = PaddingDefaultVerticalSpacing3 + bottomPadding = PaddingDefaultVerticalSpacing3 + } + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + + private enum CodingKeys: String, CodingKey { + case moleculeName + case headlineBody + case link + } + + //-------------------------------------------------- + // MARK: - Codec + //-------------------------------------------------- + + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody) + link = try typeContainer.decode(LinkModel.self, forKey: .link) + try super.init(from: decoder) + } + + public override func encode(to encoder: Encoder) throws { + try super.encode(to: encoder) + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encode(headlineBody, forKey: .headlineBody) + try container.encode(link, forKey: .link) + } +} From d47365864f5979f59c03afb000bff64510aa5b29 Mon Sep 17 00:00:00 2001 From: Kyle Matthew Hedden Date: Wed, 24 Jun 2020 15:39:09 -0400 Subject: [PATCH 68/80] add logging for tracing template parsing errors back to the source. --- .../Atomic/Atoms/Views/WebViewModel.swift | 2 +- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 2 +- .../BaseControllers/ViewController.swift | 28 +++++++++++++++++++ .../Legacy/Adapters/ActionModelAdapter.swift | 2 +- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/WebViewModel.swift b/MVMCoreUI/Atomic/Atoms/Views/WebViewModel.swift index 25142fa5..7e70d0f0 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/WebViewModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/WebViewModel.swift @@ -32,7 +32,7 @@ import Foundation url = try typeContainer.decodeIfPresent(URL.self, forKey: .url) htmlString = try typeContainer.decodeIfPresent(String.self, forKey: .htmlString) if url == nil, htmlString == nil { - throw ModelRegistry.Error.decoderErrorModelNotMapped + throw ModelRegistry.Error.decoderErrorModelNotMapped() } height = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .height) borderColor = try typeContainer.decodeIfPresent(Color.self, forKey: .borderColor) diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index c6bb77bb..0a242707 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -38,7 +38,7 @@ import Foundation public func getMoleculeModelForJSON(_ json: [String: Any]) throws -> MoleculeModelProtocol? { guard let moleculeName = json.optionalStringForKey(KeyMoleculeName), let type = ModelRegistry.getType(for: moleculeName, with: MoleculeModelProtocol.self) else { - throw ModelRegistry.Error.decoderErrorModelNotMapped + throw ModelRegistry.Error.decoderErrorModelNotMapped() } guard let model = try type.decode(jsonDict: json) as? MoleculeModelProtocol else { throw ModelRegistry.Error.decoderError diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index 6e1b35ff..8c63ed51 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -119,6 +119,7 @@ import UIKit return true } catch let parsingError { // Log all parsing errors and fail load. + handleLoggingFor(parsingError: parsingError) if let errorObject = MVMCoreErrorObject.createErrorObject(for: parsingError, location: MVMCoreLoadHandler.sharedGlobal()?.errorLocation(forRequest: loadObject)) { errorObject.messageToDisplay = MVMCoreGetterUtility.hardcodedString(withKey: HardcodedErrorUnableToProcess) error.pointee = errorObject @@ -127,6 +128,33 @@ import UIKit } } + func handleLoggingFor(parsingError: Error) { + if let registryError = parsingError as? ModelRegistry.Error { + switch (registryError) { + case .decoderErrorModelNotMapped(let identifier, let codingKey, let codingPath) where identifier != nil && codingKey != nil && codingPath != nil: + MVMCoreLoggingHandler.shared()?.handleDebugMessage("Error parsing template: Model identifier \"\(identifier!)\" is not mapped for \"\(codingKey!.stringValue)\" @ \(codingPath!.map { return $0.stringValue })") + case .decoderErrorObjectNotPresent(let codingKey, codingPath: let codingPath): + MVMCoreLoggingHandler.shared()?.handleDebugMessage("Error parsing template: Required model \"\(codingKey.stringValue)\" was not found @ \(codingPath.map { return $0.stringValue })") + default: + MVMCoreLoggingHandler.shared()?.handleDebugMessage("Error parsing template: Registry error: \(registryError)") + } + } + if let decodingError = parsingError as? DecodingError { + switch (decodingError) { + case .keyNotFound(let codingKey, let context): + MVMCoreLoggingHandler.shared()?.handleDebugMessage("Error parsing template: Key \(codingKey.stringValue) was not found @ \(context.codingPath.map { return $0.stringValue })") + case .valueNotFound(_, let context): + MVMCoreLoggingHandler.shared()?.handleDebugMessage("Error parsing template: Value not found @ \(context.codingPath.map { return $0.stringValue })") + case .typeMismatch(_, let context): + MVMCoreLoggingHandler.shared()?.handleDebugMessage("Error parsing template: Type mismatch @ \(context.codingPath.map { return $0.stringValue })") + case .dataCorrupted(let context): + MVMCoreLoggingHandler.shared()?.handleDebugMessage("Error parsing template: Data corrupted @ \(context.codingPath.map { return $0.stringValue })") + @unknown default: + MVMCoreLoggingHandler.shared()?.handleDebugMessage("Error parsing template: \(parsingError)") + } + } + } + open func parsePageJSON() throws { } diff --git a/MVMCoreUI/Legacy/Adapters/ActionModelAdapter.swift b/MVMCoreUI/Legacy/Adapters/ActionModelAdapter.swift index 5e45b6ed..f88ca5ec 100644 --- a/MVMCoreUI/Legacy/Adapters/ActionModelAdapter.swift +++ b/MVMCoreUI/Legacy/Adapters/ActionModelAdapter.swift @@ -13,7 +13,7 @@ public extension Dictionary { throw ModelRegistry.Error.decoderOther(message: "Dictionary is not of type [String: Any]") } guard let actionType = ModelRegistry.getType(for: castedSelf.stringForkey(KeyActionType), with: ActionModelProtocol.self) else { - throw ModelRegistry.Error.decoderErrorModelNotMapped + throw ModelRegistry.Error.decoderErrorModelNotMapped() } guard let actionModel = try actionType.decode(jsonDict: castedSelf) as? ActionModelProtocol else { throw ModelRegistry.Error.decoderOther(message: "Could not decode to ActionModelProtocol") From 28c8c5216656f0041903edc1c51f8cd38dc640ca Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Thu, 25 Jun 2020 19:04:23 +0530 Subject: [PATCH 69/80] Added top and bottom padding for H2 header molecule. --- .../Headers/H2/HeadersH2PricingTwoRowsModel.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift index 219f539f..ff0955e7 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift @@ -40,6 +40,8 @@ public class HeadersH2PricingTwoRowsModel: HeaderModel, MoleculeModelProtocol { //-------------------------------------------------- public override func setDefaults() { super.setDefaults() + topPadding = PaddingDefaultVerticalSpacing3 + bottomPadding = PaddingDefaultVerticalSpacing3 subBody?.attributes = [LabelAttributeStrikeThroughModel(0, subBody?.text.count ?? 0)] subBody2?.attributes = [LabelAttributeStrikeThroughModel(0, subBody2?.text.count ?? 0)] subBody3?.attributes = [LabelAttributeStrikeThroughModel(0, subBody3?.text.count ?? 0)] From e2f2fb428681eaf602bb926d619bbb75b4e3d67e Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 25 Jun 2020 10:01:19 -0400 Subject: [PATCH 70/80] New right variable Toggle fixes --- MVMCoreUI.xcodeproj/project.pbxproj | 12 +- MVMCoreUI/Atomic/Atoms/Views/Toggle.swift | 10 +- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 + ...stRightVariableToggleAllTextAndLinks.swift | 112 ++++++++++++++++++ ...htVariableToggleAllTextAndLinksModel.swift | 58 +++++++++ 5 files changed, 190 insertions(+), 3 deletions(-) create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableToggleAllTextAndLinks.swift create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableToggleAllTextAndLinksModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 6c80ccd2..676d554f 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -290,6 +290,8 @@ D224799B231965AD003FCCF9 /* AccordionMoleculeTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D224799A231965AD003FCCF9 /* AccordionMoleculeTableViewCell.swift */; }; D22D8393241C27B100D3DF69 /* TemplateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D22D8392241C27B100D3DF69 /* TemplateModel.swift */; }; D22D8395241FB41200D3DF69 /* UIStackView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D22D8394241FB41200D3DF69 /* UIStackView+Extension.swift */; }; + D2351C7A24A4D433007DF0BC /* ListRightVariableToggleAllTextAndLinksModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2351C7924A4D433007DF0BC /* ListRightVariableToggleAllTextAndLinksModel.swift */; }; + D2351C7C24A4D4C3007DF0BC /* ListRightVariableToggleAllTextAndLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2351C7B24A4D4C3007DF0BC /* ListRightVariableToggleAllTextAndLinks.swift */; }; D236E5B4241FEB1000C38625 /* ListTwoColumnPriceDescription.swift in Sources */ = {isa = PBXBuildFile; fileRef = D236E5B2241FEB1000C38625 /* ListTwoColumnPriceDescription.swift */; }; D236E5B5241FEB1000C38625 /* ListTwoColumnPriceDescriptionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D236E5B3241FEB1000C38625 /* ListTwoColumnPriceDescriptionModel.swift */; }; D236E5B7242007C500C38625 /* MVMControllerModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = D236E5B6242007C500C38625 /* MVMControllerModelProtocol.swift */; }; @@ -744,6 +746,8 @@ D224799A231965AD003FCCF9 /* AccordionMoleculeTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccordionMoleculeTableViewCell.swift; sourceTree = ""; }; D22D8392241C27B100D3DF69 /* TemplateModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TemplateModel.swift; sourceTree = ""; }; D22D8394241FB41200D3DF69 /* UIStackView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIStackView+Extension.swift"; sourceTree = ""; }; + D2351C7924A4D433007DF0BC /* ListRightVariableToggleAllTextAndLinksModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariableToggleAllTextAndLinksModel.swift; sourceTree = ""; }; + D2351C7B24A4D4C3007DF0BC /* ListRightVariableToggleAllTextAndLinks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariableToggleAllTextAndLinks.swift; sourceTree = ""; }; D236E5B2241FEB1000C38625 /* ListTwoColumnPriceDescription.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListTwoColumnPriceDescription.swift; sourceTree = ""; }; D236E5B3241FEB1000C38625 /* ListTwoColumnPriceDescriptionModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListTwoColumnPriceDescriptionModel.swift; sourceTree = ""; }; D236E5B6242007C500C38625 /* MVMControllerModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVMControllerModelProtocol.swift; sourceTree = ""; }; @@ -1152,6 +1156,8 @@ 8D8067D22444473A00203BE8 /* ListRightVariablePriceChangeAllTextAndLinks.swift */, C7F8012223E846C300396FBD /* ListRVWheelModel.swift */, C7F8012023E8303200396FBD /* ListRVWheel.swift */, + D2351C7924A4D433007DF0BC /* ListRightVariableToggleAllTextAndLinksModel.swift */, + D2351C7B24A4D4C3007DF0BC /* ListRightVariableToggleAllTextAndLinks.swift */, ); path = RightVariable; sourceTree = ""; @@ -1502,7 +1508,7 @@ children = ( AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */, AA104AC624472DB0004D2810 /* HeadersH1Button.swift */, - AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */, + AA104ADB244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift */, AA104AD9244734DB004D2810 /* HeadersH1LandingPageHeader.swift */, ); path = H1; @@ -1517,7 +1523,7 @@ AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */, AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */, AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */, - AA633B3024989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift */, + AA633B3024989EC000731E80 /* HeadersH2PricingTwoRowsModel.swift */, AA633B3224989ED500731E80 /* HeadersH2PricingTwoRows.swift */, ); path = H2; @@ -2310,6 +2316,7 @@ BB55B51D244482C1002001AD /* ListRightVariablePriceChangeBodyText.swift in Sources */, 017BEB382360C6AC0024EF95 /* RadioButtonLabel.swift in Sources */, D28A837923C7D5BC00DFE4FC /* PageModelProtocol.swift in Sources */, + D2351C7C24A4D4C3007DF0BC /* ListRightVariableToggleAllTextAndLinks.swift in Sources */, 017BEB7B236763000024EF95 /* LineModel.swift in Sources */, D256E9932412880000360572 /* Header.swift in Sources */, 94C2D9A523872C350006CF46 /* LabelAttributeFontModel.swift in Sources */, @@ -2407,6 +2414,7 @@ AA26850E244840C300CE34CC /* HeadersH2TinyButtonModel.swift in Sources */, D260105F23D0BFFC00764D80 /* StackItem.swift in Sources */, 9432A79F23DB47BA00719041 /* EntryFieldContainer.swift in Sources */, + D2351C7A24A4D433007DF0BC /* ListRightVariableToggleAllTextAndLinksModel.swift in Sources */, 01EB369323609801006832FA /* HeaderModel.swift in Sources */, 8DE5BECF2456F7B100772E76 /* ListTwoColumnDropdownSelectors.swift in Sources */, D2E1FADF2268B8E700AEFD8C /* ThreeLayerTableViewController.swift in Sources */, diff --git a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift index 17fabef7..bfa5ba33 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift @@ -159,7 +159,6 @@ public typealias ActionBlockConfirmation = () -> (Bool) public override init(frame: CGRect) { super.init(frame: frame) - setupView() } public convenience override init() { @@ -305,6 +304,15 @@ public typealias ActionBlockConfirmation = () -> (Bool) isAnimated = isAnimatedState } + override open func accessibilityActivate() -> Bool { + // Hold state in case User wanted isAnimated to remain off. + let isAnimatedState = isAnimated + isAnimated = false + sendActions(for: .touchUpInside) + isAnimated = isAnimatedState + return true + } + //-------------------------------------------------- // MARK: - UIResponder //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index c6bb77bb..2ac82b23 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -180,6 +180,7 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: ListRightVariableButtonAllTextAndLinks.self, viewModelClass: ListRightVariableButtonAllTextAndLinksModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListRightVariablePriceChangeBodyText.self, viewModelClass: ListRightVariablePriceChangeBodyTextModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListRightVariablePriceChangeAllTextAndLinks.self, viewModelClass: ListRightVariablePriceChangeAllTextAndLinksModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: ListRightVariableToggleAllTextAndLinks.self, viewModelClass: ListRightVariableToggleAllTextAndLinksModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListOneColumnFullWidthTextAllTextAndLinks.self, viewModelClass: ListOneColumnFullWidthTextAllTextAndLinksModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListOneColumnFullWidthTextBodyText.self, viewModelClass: ListOneColumnFullWidthTextBodyTextModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListTwoColumnCompareChanges.self, viewModelClass: ListTwoColumnCompareChangesModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableToggleAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableToggleAllTextAndLinks.swift new file mode 100644 index 00000000..9d5f6b84 --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableToggleAllTextAndLinks.swift @@ -0,0 +1,112 @@ +// +// ListRightVariableToggleAllTextAndLinks.swift +// MVMCoreUI +// +// Created by Scott Pfeil on 6/25/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +@objcMembers open class ListRightVariableToggleAllTextAndLinks: TableViewCell { + //----------------------------------------------------- + // MARK: - Outlets + //----------------------------------------------------- + + public let toggle = Toggle() + public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink() + + //----------------------------------------------------- + // MARK: - Properties + //----------------------------------------------------- + + public var stack: Stack! + + //-------------------------------------------------- + // MARK: - Initializers + //-------------------------------------------------- + + public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + stack = Stack.createStack(with: [(view: eyebrowHeadlineBodyLink, model: StackItemModel(horizontalAlignment: .leading)), + (view: toggle, model: StackItemModel(horizontalAlignment: .fill))], + axis: .horizontal) + super.init(style: style, reuseIdentifier: reuseIdentifier) + } + + public required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + + //----------------------------------------------------- + // MARK: - Lifecycle + //----------------------------------------------------- + + override open func setupView() { + super.setupView() + addMolecule(stack) + stack.restack() + accessibilityHint = toggle.accessibilityHint + accessibilityTraits = toggle.accessibilityTraits + } + + //----------------------------------------------------- + // MARK: - Molecular + //----------------------------------------------------- + + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { + super.set(with: model, delegateObject, additionalData) + guard let model = model as? ListRightVariableToggleAllTextAndLinksModel else { return } + toggle.set(with: model.toggle, delegateObject, additionalData) + eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) + updateAccessibilityLabel() + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + return 90 + } + + //---------------------------------------------------- + // MARK: - Accessibility + //---------------------------------------------------- + + func getAccessibilityMessage() -> String? { + guard let toggleMessage = toggle.accessibilityLabel else { + return eyebrowHeadlineBodyLink.getAccessibilityMessage() + } + guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else { + return toggleMessage + } + return label + ", " + toggleMessage + } + + func updateAccessibilityLabel() { + accessibilityValue = toggle.accessibilityValue + let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 + if !linkShowing && accessoryView == nil { + // Make whole cell focusable if one action + isAccessibilityElement = true + accessibilityLabel = getAccessibilityMessage() + } else { + // Make buttons focusable. + isAccessibilityElement = false + var elements: [Any] = [] + if let accessoryView = accessoryView { + accessoryView.accessibilityLabel = eyebrowHeadlineBodyLink.getAccessibilityMessage() + elements.append(accessoryView) + } else { + toggle.accessibilityLabel = getAccessibilityMessage() + } + elements.append(toggle) + + if linkShowing { + elements.append(eyebrowHeadlineBodyLink.link) + } + accessibilityElements = elements + } + } + + open override func accessibilityActivate() -> Bool { + return toggle.accessibilityActivate() + } +} diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableToggleAllTextAndLinksModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableToggleAllTextAndLinksModel.swift new file mode 100644 index 00000000..9fdc16ca --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableToggleAllTextAndLinksModel.swift @@ -0,0 +1,58 @@ +// +// ListRightVariableToggleAllTextAndLinksModel.swift +// MVMCoreUI +// +// Created by Scott Pfeil on 6/25/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation + +public class ListRightVariableToggleAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol { + //-------------------------------------------------- + // MARK: - Properties + //-------------------------------------------------- + + public static var identifier: String = "listRVTgl" + public var toggle: ToggleModel + public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(toggle: ToggleModel, eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel) { + self.toggle = toggle + self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink + super.init() + } + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + + private enum CodingKeys: String, CodingKey { + case moleculeName + case toggle + case eyebrowHeadlineBodyLink + } + + //-------------------------------------------------- + // MARK: - codec + //-------------------------------------------------- + + required public init(from decoder: Decoder) throws { + let typeContainer = try decoder.container(keyedBy: CodingKeys.self) + toggle = try typeContainer.decode(ToggleModel.self, forKey: .toggle) + eyebrowHeadlineBodyLink = try typeContainer.decode(EyebrowHeadlineBodyLinkModel.self, forKey: .eyebrowHeadlineBodyLink) + try super.init(from: decoder) + } + + public override func encode(to encoder: Encoder) throws { + try super.encode(to: encoder) + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) + try container.encode(toggle, forKey: .toggle) + try container.encode(eyebrowHeadlineBodyLink, forKey: .eyebrowHeadlineBodyLink) + } +} From 6c5f80aa0b9681b252a42df782bf85769a432d4f Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 25 Jun 2020 10:18:59 -0400 Subject: [PATCH 71/80] list toggle accessibility fix --- .../ListRightVariableToggleAllTextAndLinks.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableToggleAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableToggleAllTextAndLinks.swift index 9d5f6b84..ca2a3b92 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableToggleAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableToggleAllTextAndLinks.swift @@ -107,6 +107,8 @@ import Foundation } open override func accessibilityActivate() -> Bool { - return toggle.accessibilityActivate() + let activate = toggle.accessibilityActivate() + accessibilityValue = toggle.accessibilityValue + return activate } } From 1e90e33b1e5c91decdf9c27b48561bacebd75300 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 25 Jun 2020 10:54:51 -0400 Subject: [PATCH 72/80] fix enabled state for toggle --- MVMCoreUI/Atomic/Atoms/Views/Toggle.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift index 17fabef7..98619c8f 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift @@ -96,8 +96,8 @@ public typealias ActionBlockConfirmation = () -> (Bool) }, completion: nil) } else { - backgroundColor = isOn ? containerTintColor.on : containerTintColor.off - knobView.backgroundColor = isOn ? knobTintColor.on : knobTintColor.off + backgroundColor = isEnabled ? isOn ? containerTintColor.on : containerTintColor.off : disabledTintColor.container + knobView.backgroundColor = isEnabled ? isOn ? knobTintColor.on : knobTintColor.off : disabledTintColor.knob self.constrainKnob() } From 9d15c7c3dbaed3ca82485f499a3f39cf00d6396d Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 25 Jun 2020 10:56:49 -0400 Subject: [PATCH 73/80] update hint for deactivated. --- MVMCoreUI/Atomic/Atoms/Views/Toggle.swift | 2 ++ .../ListRightVariableToggleAllTextAndLinks.swift | 4 ++-- .../SupportingFiles/Strings/en.lproj/Localizable.strings | 2 +- .../SupportingFiles/Strings/es-MX.lproj/Localizable.strings | 1 + .../SupportingFiles/Strings/es.lproj/Localizable.strings | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift index bfa5ba33..d4e090aa 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift @@ -64,6 +64,7 @@ public typealias ActionBlockConfirmation = () -> (Bool) changeStateNoAnimation(isEnabled ? isOn : false) backgroundColor = isEnabled ? (isOn ? containerTintColor.on : containerTintColor.off) : disabledTintColor.container knobView.backgroundColor = isEnabled ? (isOn ? knobTintColor.on : knobTintColor.off) : disabledTintColor.knob + accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: isEnabled ? "AccToggleHint" : "AccDisabled") } } @@ -306,6 +307,7 @@ public typealias ActionBlockConfirmation = () -> (Bool) override open func accessibilityActivate() -> Bool { // Hold state in case User wanted isAnimated to remain off. + guard isUserInteractionEnabled == true else { return false } let isAnimatedState = isAnimated isAnimated = false sendActions(for: .touchUpInside) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableToggleAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableToggleAllTextAndLinks.swift index ca2a3b92..a631616b 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableToggleAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableToggleAllTextAndLinks.swift @@ -46,8 +46,6 @@ import Foundation super.setupView() addMolecule(stack) stack.restack() - accessibilityHint = toggle.accessibilityHint - accessibilityTraits = toggle.accessibilityTraits } //----------------------------------------------------- @@ -81,6 +79,8 @@ import Foundation } func updateAccessibilityLabel() { + accessibilityHint = toggle.accessibilityHint + accessibilityTraits = toggle.accessibilityTraits accessibilityValue = toggle.accessibilityValue let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 if !linkShowing && accessoryView == nil { diff --git a/MVMCoreUI/SupportingFiles/Strings/en.lproj/Localizable.strings b/MVMCoreUI/SupportingFiles/Strings/en.lproj/Localizable.strings index da55d597..74b907e3 100644 --- a/MVMCoreUI/SupportingFiles/Strings/en.lproj/Localizable.strings +++ b/MVMCoreUI/SupportingFiles/Strings/en.lproj/Localizable.strings @@ -9,7 +9,7 @@ // MARK: Accessibility "AccCloseButton" = "Close"; "swipe_to_select_with_action_hint" = "swipe up or down to select action, then double tap to select."; - +"AccDisabled" = "Disabled"; // MARK: Tab "AccTab" = ", tab"; diff --git a/MVMCoreUI/SupportingFiles/Strings/es-MX.lproj/Localizable.strings b/MVMCoreUI/SupportingFiles/Strings/es-MX.lproj/Localizable.strings index 0a9eadb9..b3b6298c 100644 --- a/MVMCoreUI/SupportingFiles/Strings/es-MX.lproj/Localizable.strings +++ b/MVMCoreUI/SupportingFiles/Strings/es-MX.lproj/Localizable.strings @@ -8,6 +8,7 @@ // Accessibility "swipe_to_select_with_action_hint" = "deslízate hacia arriba o hacia abajo para seleccionar la acción, luego toca dos veces para seleccionar."; +"AccDisabled" = "desactivado"; "AccCloseButton" = "Cerrar"; // Tab diff --git a/MVMCoreUI/SupportingFiles/Strings/es.lproj/Localizable.strings b/MVMCoreUI/SupportingFiles/Strings/es.lproj/Localizable.strings index bbc45f4a..8e0dbd02 100644 --- a/MVMCoreUI/SupportingFiles/Strings/es.lproj/Localizable.strings +++ b/MVMCoreUI/SupportingFiles/Strings/es.lproj/Localizable.strings @@ -8,6 +8,7 @@ // Accessibility "swipe_to_select_with_action_hint" = "deslízate hacia arriba o hacia abajo para seleccionar la acción, luego toca dos veces para seleccionar."; +"AccDisabled" = "desactivado"; "AccCloseButton" = "Cerrar"; // Tab From c8ac41fbadd74d61169240953fbdd0b53f28ae16 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 25 Jun 2020 10:58:04 -0400 Subject: [PATCH 74/80] refactored --- MVMCoreUI/Atomic/Atoms/Views/Toggle.swift | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift index 98619c8f..7407fa61 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift @@ -62,8 +62,7 @@ public typealias ActionBlockConfirmation = () -> (Bool) didSet { isUserInteractionEnabled = isEnabled changeStateNoAnimation(isEnabled ? isOn : false) - backgroundColor = isEnabled ? (isOn ? containerTintColor.on : containerTintColor.off) : disabledTintColor.container - knobView.backgroundColor = isEnabled ? (isOn ? knobTintColor.on : knobTintColor.off) : disabledTintColor.knob + setToggleAppearanceFromState() } } @@ -96,8 +95,7 @@ public typealias ActionBlockConfirmation = () -> (Bool) }, completion: nil) } else { - backgroundColor = isEnabled ? isOn ? containerTintColor.on : containerTintColor.off : disabledTintColor.container - knobView.backgroundColor = isEnabled ? isOn ? knobTintColor.on : knobTintColor.off : disabledTintColor.knob + setToggleAppearanceFromState() self.constrainKnob() } @@ -342,6 +340,12 @@ public typealias ActionBlockConfirmation = () -> (Bool) // MARK: - Animations //-------------------------------------------------- + public func setToggleAppearanceFromState() { + + backgroundColor = isEnabled ? isOn ? containerTintColor.on : containerTintColor.off : disabledTintColor.container + knobView.backgroundColor = isEnabled ? isOn ? knobTintColor.on : knobTintColor.off : disabledTintColor.knob + } + public func knobReformAnimation() { if isAnimated { From aaca9583351aa34296364b6ebdc4c891e8f3b845 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 25 Jun 2020 13:48:45 -0400 Subject: [PATCH 75/80] push code reduction --- MVMCoreUI/Atomic/Atoms/Views/Toggle.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift index 5be3ce31..2e50dfca 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift @@ -305,7 +305,7 @@ public typealias ActionBlockConfirmation = () -> (Bool) override open func accessibilityActivate() -> Bool { // Hold state in case User wanted isAnimated to remain off. - guard isUserInteractionEnabled == true else { return false } + guard isUserInteractionEnabled else { return false } let isAnimatedState = isAnimated isAnimated = false sendActions(for: .touchUpInside) From eb193b16de0e51fd55d137ddcde323cc704cb758 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 25 Jun 2020 17:35:59 -0400 Subject: [PATCH 76/80] dimension changes as per invision --- MVMCoreUI/Atomic/Atoms/Views/Toggle.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift index 17fabef7..ed2a015b 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift @@ -44,8 +44,8 @@ public typealias ActionBlockConfirmation = () -> (Bool) }() // Sizes are from InVision design specs. - static let containerSize = CGSize(width: 46, height: 24) - static let knobSize = CGSize(width: 22, height: 22) + static let containerSize = CGSize(width: 51, height: 31) + static let knobSize = CGSize(width: 28, height: 28) private var knobView: View = { let view = View() From 4da8eddd8dc7ba3964935ee4acfa8aac98928de9 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 25 Jun 2020 17:57:42 -0400 Subject: [PATCH 77/80] corner radius --- MVMCoreUI/Atomic/Atoms/Views/Toggle.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift index ed2a015b..597b50ae 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift @@ -50,7 +50,7 @@ public typealias ActionBlockConfirmation = () -> (Bool) private var knobView: View = { let view = View() view.backgroundColor = .white - view.layer.cornerRadius = Toggle.getKnobHeight() / 2.0 + view.layer.cornerRadius = 14 return view }() @@ -205,9 +205,6 @@ public typealias ActionBlockConfirmation = () -> (Bool) knobHeightConstraint?.constant = Self.getKnobHeight() knobWidthConstraint?.constant = Self.getKnobWidth() - layer.cornerRadius = Self.getContainerHeight() / 2.0 - knobView.layer.cornerRadius = Self.getKnobHeight() / 2.0 - changeStateNoAnimation(isOn) } @@ -225,7 +222,7 @@ public typealias ActionBlockConfirmation = () -> (Bool) widthConstraint = widthAnchor.constraint(equalToConstant: Self.containerSize.width) widthConstraint?.isActive = true - layer.cornerRadius = Self.containerSize.height / 2.0 + layer.cornerRadius = 15 backgroundColor = containerTintColor.off addSubview(knobView) From f2f26c60a24da68f16e5be92cdc4aa35e3516968 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 25 Jun 2020 18:08:52 -0400 Subject: [PATCH 78/80] latest dimensions --- MVMCoreUI/Atomic/Atoms/Views/Toggle.swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift index ccf11073..02373958 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift @@ -50,7 +50,7 @@ public typealias ActionBlockConfirmation = () -> (Bool) private var knobView: View = { let view = View() view.backgroundColor = .white - view.layer.cornerRadius = 14 + view.layer.cornerRadius = Toggle.getKnobHeight() / 2.0 return view }() @@ -142,14 +142,14 @@ public typealias ActionBlockConfirmation = () -> (Bool) private func constrainKnobOn() { - knobTrailingConstraint = trailingAnchor.constraint(equalTo: knobView.trailingAnchor, constant: 1) + knobTrailingConstraint = trailingAnchor.constraint(equalTo: knobView.trailingAnchor, constant: 2) knobLeadingConstraint = knobView.leadingAnchor.constraint(greaterThanOrEqualTo: leadingAnchor) } private func constrainKnobOff() { knobTrailingConstraint = trailingAnchor.constraint(greaterThanOrEqualTo: knobView.trailingAnchor) - knobLeadingConstraint = knobView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 1) + knobLeadingConstraint = knobView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 2) } //-------------------------------------------------- @@ -203,6 +203,9 @@ public typealias ActionBlockConfirmation = () -> (Bool) knobHeightConstraint?.constant = Self.getKnobHeight() knobWidthConstraint?.constant = Self.getKnobWidth() + layer.cornerRadius = Self.getContainerHeight() / 2.0 + knobView.layer.cornerRadius = Self.getKnobHeight() / 2.0 + changeStateNoAnimation(isOn) } @@ -220,7 +223,7 @@ public typealias ActionBlockConfirmation = () -> (Bool) widthConstraint = widthAnchor.constraint(equalToConstant: Self.containerSize.width) widthConstraint?.isActive = true - layer.cornerRadius = 15 + layer.cornerRadius = Self.getContainerHeight() / 2.0 backgroundColor = containerTintColor.off addSubview(knobView) From aa23c9298773eb8326c889271e74373e808a4eae Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 29 Jun 2020 14:59:57 -0400 Subject: [PATCH 79/80] very minor cleaning --- .../DesignedComponents/Headers/H2/HeadersH2Link.swift | 2 +- .../Headers/H2/HeadersH2LinkModel.swift | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2Link.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2Link.swift index 4b0334e7..c5aaefc8 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2Link.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2Link.swift @@ -20,7 +20,7 @@ import Foundation // MARK: - Initializers //------------------------------------------------------- public override init(frame: CGRect) { - stack = Stack.createStack(with: [headlineBody, link], spacing: PaddingHorizontalBetweenRelatedItems) + stack = Stack.createStack(with: [headlineBody, link]) super.init(frame: frame) } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift index 5793eedf..66189f99 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift @@ -32,9 +32,13 @@ public class HeadersH2LinkModel: HeaderModel, MoleculeModelProtocol { //-------------------------------------------------- public override func setDefaults() { + if topPadding == nil { + topPadding = Padding.Component.VerticalMarginSpacing + } + if bottomPadding == nil { + bottomPadding = Padding.Component.VerticalMarginSpacing + } super.setDefaults() - topPadding = PaddingDefaultVerticalSpacing3 - bottomPadding = PaddingDefaultVerticalSpacing3 } //-------------------------------------------------- From 625bc1ca013d329f81ab344ba62cea8400122365 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 29 Jun 2020 15:06:14 -0400 Subject: [PATCH 80/80] Modernize variable --- .../Headers/H2/HeadersH2ButtonsModel.swift | 8 ++++++-- .../Headers/H2/HeadersH2NoButtonsBodyTextModel.swift | 8 ++++++-- .../Headers/H2/HeadersH2PricingTwoRowsModel.swift | 8 ++++++-- .../Headers/H2/HeadersH2TinyButtonModel.swift | 8 ++++++-- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift index 3cb09a0f..d3ea7497 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift @@ -33,9 +33,13 @@ public class HeadersH2ButtonsModel: HeaderModel, MoleculeModelProtocol { //-------------------------------------------------- public override func setDefaults() { + if topPadding == nil { + topPadding = Padding.Component.VerticalMarginSpacing + } + if bottomPadding == nil { + bottomPadding = Padding.Component.VerticalMarginSpacing + } super.setDefaults() - topPadding = PaddingDefaultVerticalSpacing3 - bottomPadding = PaddingDefaultVerticalSpacing3 } //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift index a6cfc0ce..96d30730 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift @@ -27,9 +27,13 @@ public class HeadersH2NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol } public override func setDefaults() { + if topPadding == nil { + topPadding = Padding.Component.VerticalMarginSpacing + } + if bottomPadding == nil { + bottomPadding = Padding.Component.VerticalMarginSpacing + } super.setDefaults() - topPadding = PaddingDefaultVerticalSpacing3 - bottomPadding = PaddingDefaultVerticalSpacing3 } //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift index ff0955e7..01bd72e4 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift @@ -39,9 +39,13 @@ public class HeadersH2PricingTwoRowsModel: HeaderModel, MoleculeModelProtocol { // MARK: - Methods //-------------------------------------------------- public override func setDefaults() { + if topPadding == nil { + topPadding = Padding.Component.VerticalMarginSpacing + } + if bottomPadding == nil { + bottomPadding = Padding.Component.VerticalMarginSpacing + } super.setDefaults() - topPadding = PaddingDefaultVerticalSpacing3 - bottomPadding = PaddingDefaultVerticalSpacing3 subBody?.attributes = [LabelAttributeStrikeThroughModel(0, subBody?.text.count ?? 0)] subBody2?.attributes = [LabelAttributeStrikeThroughModel(0, subBody2?.text.count ?? 0)] subBody3?.attributes = [LabelAttributeStrikeThroughModel(0, subBody3?.text.count ?? 0)] diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift index 55c2c6e4..d4edfd38 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift @@ -33,9 +33,13 @@ public class HeadersH2TinyButtonModel: HeaderModel, MoleculeModelProtocol { //-------------------------------------------------- public override func setDefaults() { + if topPadding == nil { + topPadding = Padding.Component.VerticalMarginSpacing + } + if bottomPadding == nil { + bottomPadding = Padding.Component.VerticalMarginSpacing + } super.setDefaults() - topPadding = PaddingDefaultVerticalSpacing3 - bottomPadding = PaddingDefaultVerticalSpacing3 button.style = .secondary button.size = .tiny }