From 9620548a43030f590025cd6f8fb23a1d1168722d Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Fri, 24 Apr 2020 10:33:14 -0400 Subject: [PATCH] updates and revision --- .../Atomic/Atoms/Selectors/RadioButton.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift index af1e7905..8d2563d0 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift @@ -19,14 +19,14 @@ import UIKit widthConstraint?.constant = diameter } } - + public override var isSelected: Bool { didSet { radioModel?.state = isSelected updateAccessibilityLabel() } } - + public var enabledColor: UIColor = .mvmBlack public var disabledColor: UIColor = .mvmCoolGray3 public var delegateObject: MVMCoreUIDelegateObject? @@ -40,12 +40,12 @@ import UIKit }() lazy public var radioButtonSelectionHelper: RadioButtonSelectionHelper? = { - if let radioGroupName = radioGroupName, - let radioButtonModel = delegateObject?.formHolderDelegate?.formValidator?.radioButtonsModelByGroup[radioGroupName] { - return radioButtonModel - } else { - return nil - } + + guard let radioGroupName = radioGroupName, + let radioButtonModel = delegateObject?.formHolderDelegate?.formValidator?.radioButtonsModelByGroup[radioGroupName] + else { return nil } + + return radioButtonModel }() public override var isEnabled: Bool { @@ -128,7 +128,7 @@ import UIKit // Attention: This needs to be addressed with the accessibility team. // NOTE: Currently emptying description part of MVMCoreUICheckBox accessibility label to avoid crashing! if let state = MVMCoreUIUtility.hardcodedString(withKey: isSelected ? "radio_selected_state" : "radio_not_selected_state") { - accessibilityLabel = String(format: MVMCoreUIUtility.hardcodedString(withKey: "radio_desc_state") ?? "%@%@", "", state) + accessibilityLabel = String(format: MVMCoreUIUtility.hardcodedString(withKey: "radio_desc_state") ?? "%@%@", "", isSelected) } }