From d7c472b667d9bb0eb3d6f9d193e4c7651e628a6c Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Fri, 15 Sep 2023 01:07:20 +0530 Subject: [PATCH] added accessibilitytraits, value, label dynamically from modelJSON --- .../Device/ListDeviceComplexButtonMedium.swift | 1 + .../Device/ListDeviceComplexButtonSmall.swift | 1 + .../ListLeftVariableIconAllTextLinks.swift | 2 +- .../ListLeftVariableIconWithRightCaret.swift | 2 +- ...ariableIconWithRightCaretAllTextLinks.swift | 2 +- ...eftVariableIconWithRightCaretBodyText.swift | 2 +- ...ftVariableNumberedListAllTextAndLinks.swift | 2 +- .../ListLeftVariableNumberedListBodyText.swift | 2 +- .../List/ListProgressBarThin.swift | 2 +- .../List/Miscellaneous/ListStoreLocator.swift | 2 +- ...OneColumnFullWidthTextAllTextAndLinks.swift | 2 +- .../ListOneColumnFullWidthTextBodyText.swift | 2 +- .../List/RightVariable/ListRVWheel.swift | 2 +- ...istRightVariableButtonAllTextAndLinks.swift | 2 +- .../ListRightVariablePayments.swift | 2 +- ...ghtVariablePriceChangeAllTextAndLinks.swift | 2 +- .../ListRightVariablePriceChangeBodyText.swift | 2 +- ...ightVariableRightCaretAlltextAndLinks.swift | 4 ++-- ...tRightVariableTextLinkAllTextAndLinks.swift | 2 +- .../ListRightVariableTotalData.swift | 2 +- .../Atomic/Molecules/Items/ListItemModel.swift | 14 +++++++++++++- .../AccessibilityModelProtocol.swift | 18 ++++++++++++++++++ .../ModelProtocols/ListItemModelProtocol.swift | 2 +- MVMCoreUI/BaseClasses/TableViewCell.swift | 9 +++++++++ 24 files changed, 62 insertions(+), 21 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift index 7a9e8b7e..3dae857d 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift @@ -75,6 +75,7 @@ import Foundation delegateObject, additionalData) rightImageView.set(with: model.image, delegateObject, additionalData) updateAccessibilityLabel() + accessibilityTraits.update(with: model.accessibilityTraits ?? button.accessibilityTraits) } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift index 7f47929f..b2981158 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift @@ -73,6 +73,7 @@ delegateObject, additionalData) rightImageView.set(with: model.image, delegateObject, additionalData) updateAccessibilityLabel() + accessibilityTraits.update(with: model.accessibilityTraits ?? button.accessibilityTraits) } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift index 728d8464..ac3d2681 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift @@ -77,7 +77,7 @@ let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 isAccessibilityElement = !linkShowing - accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none + accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? (listItemModel?.accessibilityTraits ?? .button) : .none if !linkShowing { // Make whole cell focusable if no link. diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaret.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaret.swift index 8ffbf06c..2edda50e 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaret.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaret.swift @@ -91,6 +91,6 @@ } accessibilityLabel = message - accessibilityTraits = (accessoryView != nil) ? .button : .none + accessibilityTraits = (accessoryView != nil) ? (listItemModel?.accessibilityTraits ?? .button) : .none } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretAllTextLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretAllTextLinks.swift index 0c09e9e3..e062fa53 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretAllTextLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretAllTextLinks.swift @@ -99,7 +99,7 @@ func updateAccessibilityLabel() { let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 isAccessibilityElement = !linkShowing - accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none + accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? (listItemModel?.accessibilityTraits ?? .button) : .none if !linkShowing { // Make whole cell focusable if no link. diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyText.swift index 6174fc4b..d050574c 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretBodyText.swift @@ -109,6 +109,6 @@ } accessibilityLabel = message - accessibilityTraits = (accessoryView != nil) ? .button : .none + accessibilityTraits = (accessoryView != nil) ? (listItemModel?.accessibilityTraits ?? .button) : .none } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift index 75096854..d133b035 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift @@ -87,7 +87,7 @@ let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 isAccessibilityElement = !linkShowing - accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none + accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? (listItemModel?.accessibilityTraits ?? .button) : .none if !linkShowing { // Make whole cell focusable if no link. diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift index 1fff77d1..1cad67b4 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListBodyText.swift @@ -89,7 +89,7 @@ } accessibilityLabel = message - accessibilityTraits = (accessoryView != nil) ? .button : .none + accessibilityTraits = (accessoryView != nil) ? (listItemModel?.accessibilityTraits ?? .button) : .none } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListProgressBarThin.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListProgressBarThin.swift index 9b85dc4f..d612ef48 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListProgressBarThin.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListProgressBarThin.swift @@ -131,6 +131,6 @@ } accessibilityLabel = message - accessibilityTraits = (accessoryView != nil) ? .button : .none + accessibilityTraits = (accessoryView != nil) ? (listItemModel?.accessibilityTraits ?? .button) : .none } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Miscellaneous/ListStoreLocator.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Miscellaneous/ListStoreLocator.swift index 1e271e87..47f37250 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Miscellaneous/ListStoreLocator.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Miscellaneous/ListStoreLocator.swift @@ -147,7 +147,7 @@ override public var accessibilityTraits: UIAccessibilityTraits { get { if (accessoryView != nil) { - return .button + return listItemModel?.accessibilityTraits ?? .button } else if (!(horizontalStack.stackModel?.molecules[1].gone ?? true)) { return heart.accessibilityTraits } else { diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift index 6e5a7245..bc715483 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift @@ -95,7 +95,7 @@ import Foundation // Ensures voice over does not read "selected" after user triggers action on cell. override public var accessibilityTraits: UIAccessibilityTraits { get { - return (accessoryView != nil) ? .button : .none + return (accessoryView != nil) ? (listItemModel?.accessibilityTraits ?? .button) : .none } set {} } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextBodyText.swift index 7a17dd1b..764a60f2 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextBodyText.swift @@ -46,7 +46,7 @@ import Foundation /// Ensures voice over does not read "selected" after user triggers action on cell. override public var accessibilityTraits: UIAccessibilityTraits { get { - return (accessoryView != nil) ? .button : .none + return (accessoryView != nil) ? (listItemModel?.accessibilityTraits ?? .button) : .none } set {} } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRVWheel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRVWheel.swift index 46c11747..0c08b71b 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRVWheel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRVWheel.swift @@ -91,6 +91,6 @@ } accessibilityLabel = message - accessibilityTraits = (accessoryView != nil) ? .button : .none + accessibilityTraits = (accessoryView != nil) ? (listItemModel?.accessibilityTraits ?? .button) : .none } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift index bca4696a..999f2e40 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableButtonAllTextAndLinks.swift @@ -47,7 +47,7 @@ stack.restack() accessibilityValue = button.accessibilityValue accessibilityHint = button.accessibilityHint - accessibilityTraits = .button + accessibilityTraits = (listItemModel?.accessibilityTraits ?? .button) } //----------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePayments.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePayments.swift index ae482d8d..565b5c4d 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePayments.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePayments.swift @@ -83,6 +83,6 @@ } accessibilityLabel = message - accessibilityTraits = (accessoryView != nil) ? .button : .none + accessibilityTraits = (accessoryView != nil) ? (listItemModel?.accessibilityTraits ?? .button) : .none } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift index d0b2ff70..e5de7b41 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift @@ -100,7 +100,7 @@ let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 isAccessibilityElement = !linkShowing - accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none + accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? (listItemModel?.accessibilityTraits ?? .button) : .none if !linkShowing { // Make whole cell focusable if no link. diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeBodyText.swift index a03b676d..d7f90345 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeBodyText.swift @@ -98,6 +98,6 @@ } accessibilityLabel = message - accessibilityTraits = (accessoryView != nil) ? .button : .none + accessibilityTraits = (accessoryView != nil) ? (listItemModel?.accessibilityTraits ?? .button) : .none } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableRightCaretAlltextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableRightCaretAlltextAndLinks.swift index 12f11b9e..51fd0378 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableRightCaretAlltextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableRightCaretAlltextAndLinks.swift @@ -97,8 +97,8 @@ let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 isAccessibilityElement = !linkShowing - accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none - + accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? (listItemModel?.accessibilityTraits ?? .button) : .none + if !linkShowing { // Make whole cell focusable if no link. accessibilityLabel = getAccessibilityMessage() diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift index e47cae46..d7851519 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTextLinkAllTextAndLinks.swift @@ -89,7 +89,7 @@ func updateAccessibilityLabel() { let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 - accessibilityTraits = .button + accessibilityTraits = listItemModel?.accessibilityTraits ?? .button if !linkShowing && accessoryView == nil { // Make whole cell focusable if one action diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift index a749041a..407eeacf 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalData.swift @@ -95,6 +95,6 @@ } accessibilityLabel = message - accessibilityTraits = (accessoryView != nil) ? .button : .none + accessibilityTraits = (accessoryView != nil) ? (listItemModel?.accessibilityTraits ?? .button) : .none } } diff --git a/MVMCoreUI/Atomic/Molecules/Items/ListItemModel.swift b/MVMCoreUI/Atomic/Molecules/Items/ListItemModel.swift index a5320ad2..177550d2 100644 --- a/MVMCoreUI/Atomic/Molecules/Items/ListItemModel.swift +++ b/MVMCoreUI/Atomic/Molecules/Items/ListItemModel.swift @@ -18,7 +18,10 @@ public var hideArrow: Bool? public var line: LineModel? public var style: ListItemStyle? - + public var accessibilityTraits: UIAccessibilityTraits? + public var accessibilityText: String? + public var accessibilityValue: String? + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- @@ -29,6 +32,9 @@ case hideArrow case line case style + case accessibilityTraits + case accessibilityText + case accessibilityValue } //-------------------------------------------------- @@ -102,6 +108,9 @@ hideArrow = try typeContainer.decodeIfPresent(Bool.self, forKey: .hideArrow) line = try typeContainer.decodeIfPresent(LineModel.self, forKey: .line) style = try typeContainer.decodeIfPresent(ListItemStyle.self, forKey: .style) + accessibilityTraits = try typeContainer.decodeIfPresent(UIAccessibilityTraits.self, forKey: .accessibilityTraits) + accessibilityText = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityText) + accessibilityValue = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityValue) try super.init(from: decoder) } @@ -113,5 +122,8 @@ try container.encodeIfPresent(hideArrow, forKey: .hideArrow) try container.encodeIfPresent(line, forKey: .line) try container.encodeIfPresent(style, forKey: .style) + try container.encodeIfPresent(accessibilityTraits, forKey: .accessibilityTraits) + try container.encodeIfPresent(accessibilityText, forKey: .accessibilityText) + try container.encodeIfPresent(accessibilityValue, forKey: .accessibilityValue) } } diff --git a/MVMCoreUI/Atomic/Protocols/ModelProtocols/AccessibilityModelProtocol.swift b/MVMCoreUI/Atomic/Protocols/ModelProtocols/AccessibilityModelProtocol.swift index a7508e39..809334d8 100644 --- a/MVMCoreUI/Atomic/Protocols/ModelProtocols/AccessibilityModelProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/ModelProtocols/AccessibilityModelProtocol.swift @@ -12,6 +12,9 @@ import Foundation public protocol AccessibilityModelProtocol { var accessibilityIdentifier: String? { get set } + var accessibilityTraits: UIAccessibilityTraits? { get set } + var accessibilityText: String? { get set } + var accessibilityValue: String? { get set } } public extension AccessibilityModelProtocol { @@ -20,4 +23,19 @@ public extension AccessibilityModelProtocol { get { nil } set { } } + + var accessibilityTraits: UIAccessibilityTraits? { + get { nil } + set { } + } + + var accessibilityText: String? { + get { nil } + set { } + } + + var accessibilityValue: String? { + get { nil } + set { } + } } diff --git a/MVMCoreUI/Atomic/Protocols/ModelProtocols/ListItemModelProtocol.swift b/MVMCoreUI/Atomic/Protocols/ModelProtocols/ListItemModelProtocol.swift index 3c64fdb4..b3b7be7e 100644 --- a/MVMCoreUI/Atomic/Protocols/ModelProtocols/ListItemModelProtocol.swift +++ b/MVMCoreUI/Atomic/Protocols/ModelProtocols/ListItemModelProtocol.swift @@ -15,7 +15,7 @@ public enum ListItemStyle: String, Codable { case none } -public protocol ListItemModelProtocol: ContainerModelProtocol { +public protocol ListItemModelProtocol: ContainerModelProtocol, AccessibilityModelProtocol { var line: LineModel? { get set } var action: ActionModelProtocol? { get set } var hideArrow: Bool? { get set } diff --git a/MVMCoreUI/BaseClasses/TableViewCell.swift b/MVMCoreUI/BaseClasses/TableViewCell.swift index c21e2c49..f5bb8bf1 100644 --- a/MVMCoreUI/BaseClasses/TableViewCell.swift +++ b/MVMCoreUI/BaseClasses/TableViewCell.swift @@ -163,6 +163,15 @@ import UIKit // align if needed. containerHelper.set(with: model, for: molecule as? MVMCoreUIViewConstrainingProtocol) + + if let traits = model.accessibilityTraits { + accessibilityTraits.update(with: traits) + } + if let accessibilityText = model.accessibilityText { + accessibilityLabel = accessibilityText + isAccessibilityElement = true + } + accessibilityValue = model.accessibilityValue } open func reset() {