diff --git a/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift b/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift index 965656a6..10b0a105 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift @@ -43,7 +43,6 @@ addSubview(label) label.text = "" - checkbox.leadingAnchor.constraint(equalTo: layoutMarginsGuide.leadingAnchor).isActive = true checkboxBottomConstraint = layoutMarginsGuide.bottomAnchor.constraint(equalTo: checkbox.bottomAnchor) @@ -64,9 +63,8 @@ bottomLabelConstraint.isActive = true alignCheckbox(.center) - isAccessibilityElement = true - accessibilityHint = checkbox.accessibilityHint - accessibilityTraits = checkbox.accessibilityTraits + isAccessibilityElement = false + accessibilityElements = [checkbox, label] observation = observe(\.checkbox.isSelected, options: [.new]) { [weak self] _, _ in self?.updateAccessibilityLabel() } @@ -139,6 +137,9 @@ open func updateAccessibilityLabel() { checkbox.updateAccessibilityLabel() - accessibilityLabel = [checkbox.accessibilityLabel, label.text].compactMap { $0 }.joined(separator: ",") + + if let text = label.text { + checkbox.accessibilityLabel?.append(", \(text)") + } } } diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift index b394993a..adc88cb4 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/Label.swift @@ -209,6 +209,9 @@ public typealias ActionBlock = () -> () if let newFont = UIFont(name: fontName, size: fontSize ?? standardFontSize) { font = newFont } + } else if let fontSize = viewModel.fontSize { + standardFontSize = fontSize + font = textStyle.font.withSize(fontSize) } if let color = viewModel.textColor {