diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift index 62ee43f5..772ec5ac 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift @@ -41,7 +41,6 @@ import Foundation addMolecule(stack) stack.restack() isAccessibilityElement = true - updateAccessibilityLabel() } //-------------------------------------------------- @@ -53,7 +52,8 @@ import Foundation guard let model = model as? ListOneColumnTextWithWhitespaceDividerTallModel else { return } stack.updateContainedMolecules(with: [model.headline, model.body], delegateObject, additionalData) - updateAccessibilityLabel() + + updateAccessibilityLabel(model: model) } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { @@ -64,24 +64,25 @@ import Foundation super.reset() headline.setFontStyle(.BoldTitleMedium) body.setFontStyle(.RegularBodySmall) + accessibilityLabel = nil } //---------------------------------------------------- // MARK: - Accessibility //---------------------------------------------------- - func updateAccessibilityLabel() { - + func updateAccessibilityLabel(model: ListOneColumnTextWithWhitespaceDividerTallModel) { + var message = "" - - if let headlineLabel = headline.text, !headlineLabel.isEmpty { + + if let headlineLabel = model.headline.accessibilityText ?? headline.text, !headlineLabel.isEmpty { message += headlineLabel + ", " } - - if let bodyLabel = body.text, !bodyLabel.isEmpty { + + if let bodyLabel = model.body?.accessibilityText ?? body.text, !bodyLabel.isEmpty { message += bodyLabel } - + accessibilityLabel = message } }