diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift index 1b5b0697..55ae3e02 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift @@ -20,7 +20,7 @@ //-------------------------------------------------- public var stack: Stack - + public var model: MoleculeModelProtocol? private var observation: NSKeyValueObservation? = nil //-------------------------------------------------- @@ -68,6 +68,7 @@ checkbox.set(with: model.checkbox, delegateObject, additionalData) eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -93,7 +94,7 @@ message += label } - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListLeftVariableCheckboxAllTextAndLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil isAccessibilityElement = !linkShowing if !linkShowing { // Make whole cell focusable if no link. diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift index 728d8464..78b91f9f 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift @@ -15,6 +15,7 @@ public let leftImage = LoadImageView(pinnedEdges: .all) public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink() public var stack: Stack + public var model: MoleculeModelProtocol? //-------------------------------------------------- // MARK: - Initializers @@ -53,6 +54,7 @@ leftImage.set(with: model.image, delegateObject, additionalData) eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -75,7 +77,7 @@ func updateAccessibilityLabel() { - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListLeftVariableIconAllTextLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil isAccessibilityElement = !linkShowing accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretAllTextLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretAllTextLinks.swift index 0c09e9e3..683ef1ab 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretAllTextLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretAllTextLinks.swift @@ -14,7 +14,7 @@ public let leftImage = LoadImageView(pinnedEdges: .all) public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(spacing: 2.0) public let rightLabel = Label(fontStyle: .RegularBodySmall) - + public var model: MoleculeModelProtocol? public lazy var rightLabelStackItem: StackItem = { return StackItem(andContain: rightLabel) }() @@ -66,6 +66,7 @@ leftImage.set(with: model.image, delegateObject, additionalData) eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) rightLabel.set(with: model.rightLabel, delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -97,7 +98,7 @@ } func updateAccessibilityLabel() { - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListLeftVariableIconWithRightCaretAllTextLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil isAccessibilityElement = !linkShowing accessibilityTraits = (isAccessibilityElement && 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 75096854..f3afc623 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift @@ -15,6 +15,7 @@ public let leftLabel = Label(fontStyle: .Title2XLarge) public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink() public var stack: Stack + public var model: MoleculeModelProtocol? //-------------------------------------------------- // MARK: - Initializers @@ -54,6 +55,7 @@ leftLabel.text = String(model.number) eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -85,7 +87,7 @@ func updateAccessibilityLabel() { - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListLeftVariableNumberedListAllTextAndLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil isAccessibilityElement = !linkShowing accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAllTextAndLinks.swift index 730f988f..cc3e57d6 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAllTextAndLinks.swift @@ -15,7 +15,7 @@ let radioButton = RadioButton() let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink() var stack: Stack - + public var model: MoleculeModelProtocol? private var observation: NSKeyValueObservation? = nil //----------------------------------------------------- @@ -62,6 +62,7 @@ radioButton.set(with: model.radioButton, delegateObject, additionalData) eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -91,7 +92,7 @@ message += label } - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListLeftVariableRadioButtonAllTextAndLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil isAccessibilityElement = !linkShowing if !linkShowing { // Make whole cell focusable if no link. diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift index 48e3c49c..b749355d 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift @@ -18,7 +18,7 @@ import UIKit let leftImage = LoadImageView(pinnedEdges: .all) let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink() var stack: Stack - + public var model: MoleculeModelProtocol? private var observation: NSKeyValueObservation? = nil //----------------------------------------------------- @@ -79,6 +79,7 @@ import UIKit radioButton.set(with: model.radioButton, delegateObject, additionalData) leftImage.set(with: model.image, delegateObject, additionalData) eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -112,7 +113,7 @@ import UIKit message += label } - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListLeftVariableRadioButtonAndPaymentMethodModel)?.eyebrowHeadlineBodyLink.link?.title != nil isAccessibilityElement = !linkShowing if !linkShowing { // Make whole cell focusable if no link. diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift index 6e5a7245..c2c13089 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift @@ -20,6 +20,7 @@ import Foundation let subHeadline = Label(fontStyle: .BoldBodySmall) let body = Label(fontStyle: .RegularBodySmall) let link = Link() + public var model: MoleculeModelProtocol? //----------------------------------------------------- // MARK: - Initializers @@ -52,6 +53,7 @@ import Foundation stack.updateContainedMolecules(with: [model.eyebrow, model.headline, model.subHeadline, model.body, model.link], delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -102,7 +104,7 @@ import Foundation func updateAccessibilityLabel() { - let linkShowing = link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListOneColumnFullWidthTextAllTextAndLinksModel)?.link?.title != nil isAccessibilityElement = !linkShowing if !linkShowing { // Make whole cell focusable if no link. diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift index d0b2ff70..4194d112 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift @@ -18,6 +18,7 @@ private let stack: Stack private let arrowStackItem: StackItem private let rightLabelStackItem: StackItem + public var model: MoleculeModelProtocol? //----------------------------------------------------- // MARK: - Initializers @@ -73,6 +74,7 @@ eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) rightLabel.set(with: model.rightLabel, delegateObject, additionalData) arrow.set(with: model.arrow, delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -98,7 +100,7 @@ func updateAccessibilityLabel() { - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListRightVariablePriceChangeAllTextAndLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil isAccessibilityElement = !linkShowing accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableRightCaretAlltextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableRightCaretAlltextAndLinks.swift index 12f11b9e..7048a536 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableRightCaretAlltextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableRightCaretAlltextAndLinks.swift @@ -15,6 +15,7 @@ public let rightLabel = Label(fontStyle: .RegularBodySmall) public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink() public var stack: Stack + public var model: MoleculeModelProtocol? //-------------------------------------------------- // MARK: - Initializers @@ -65,6 +66,7 @@ guard let model = model as? ListRightVariableRightCaretAllTextAndLinksModel else { return } rightLabel.set(with: model.rightLabel, delegateObject, additionalData) eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -95,7 +97,7 @@ func updateAccessibilityLabel() { - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListRightVariableRightCaretAllTextAndLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil isAccessibilityElement = !linkShowing accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none