From 75632696804d4ebb44e84e07a2d6e1ca659a47b3 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 23 Oct 2019 10:36:32 -0400 Subject: [PATCH 1/3] changes to test --- MVMCoreUI.xcodeproj/project.pbxproj | 18 ++++- .../Views}/RadioButton.swift | 72 +++++++++---------- MVMCoreUI/BaseClasses/Control.swift | 52 ++++++++++++++ MVMCoreUI/BaseClasses/View.swift | 52 ++++++++++++++ MVMCoreUI/Molecules/RadioButtonModel.swift | 4 +- .../Molecules/RadioButtonWithLabel.swift | 4 +- 6 files changed, 160 insertions(+), 42 deletions(-) rename MVMCoreUI/{Molecules => Atoms/Views}/RadioButton.swift (78%) create mode 100644 MVMCoreUI/BaseClasses/Control.swift create mode 100644 MVMCoreUI/BaseClasses/View.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 2b965e63..4389ff65 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -182,6 +182,8 @@ D2A638FD22CA98280052ED1F /* HeadlineBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A638FC22CA98280052ED1F /* HeadlineBody.swift */; }; D2A6390122CBB1820052ED1F /* Carousel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A6390022CBB1820052ED1F /* Carousel.swift */; }; D2A6390522CBCE160052ED1F /* MoleculeCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A6390422CBCE160052ED1F /* MoleculeCollectionViewCell.swift */; }; + D2B18B7F2360913400A9AEDC /* Control.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B18B7E2360913400A9AEDC /* Control.swift */; }; + D2B18B812360945C00A9AEDC /* View.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B18B802360945C00A9AEDC /* View.swift */; }; D2B1E3E522F37D6A0065F95C /* ImageHeadlineBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B1E3E422F37D6A0065F95C /* ImageHeadlineBody.swift */; }; D2C5001821F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h in Headers */ = {isa = PBXBuildFile; fileRef = D2C5001621F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; D2C5001921F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m in Sources */ = {isa = PBXBuildFile; fileRef = D2C5001721F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m */; }; @@ -377,6 +379,8 @@ D2A638FC22CA98280052ED1F /* HeadlineBody.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadlineBody.swift; sourceTree = ""; }; D2A6390022CBB1820052ED1F /* Carousel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Carousel.swift; sourceTree = ""; }; D2A6390422CBCE160052ED1F /* MoleculeCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeCollectionViewCell.swift; sourceTree = ""; }; + D2B18B7E2360913400A9AEDC /* Control.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Control.swift; sourceTree = ""; }; + D2B18B802360945C00A9AEDC /* View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = View.swift; sourceTree = ""; }; D2B1E3E422F37D6A0065F95C /* ImageHeadlineBody.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageHeadlineBody.swift; sourceTree = ""; }; D2C5001621F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUIViewControllerMappingObject.h; sourceTree = ""; }; D2C5001721F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreUIViewControllerMappingObject.m; sourceTree = ""; }; @@ -508,6 +512,7 @@ D29DF0CE21E404D4003B2FB9 /* MVMCoreUI */ = { isa = PBXGroup; children = ( + D2B18B7D236090D500A9AEDC /* BaseClasses */, 01C74D87224298E2009C25A3 /* FormUIHelpers */, D29DF31421ECECA7003B2FB9 /* SupportingFiles */, D29DF27021E79B2C003B2FB9 /* OtherHandlers */, @@ -574,7 +579,6 @@ D29770C621F7C4AE00B2F0D0 /* TopLabelsView.m */, D2A514662213885800345BFB /* StandardHeaderView.swift */, D274CA322236A78900B01B62 /* StandardFooterView.swift */, - 01004F2F22721C3800991ECC /* RadioButton.swift */, 01FC09E2235E246D003AC9B3 /* RadioButtonWithLabel.swift */, 0116A4E4228B19640094F3ED /* RadioButtonModel.swift */, D29B770F22C281F400D6ACE0 /* ModuleMolecule.swift */, @@ -740,6 +744,7 @@ 0198F7A22256A80A0066C936 /* MFRadioButton.m */, 0A7BAFA0232BE61800FB8E22 /* Checkbox.swift */, 0A7BAFA2232BE63400FB8E22 /* CheckboxWithLabelView.swift */, + 01004F2F22721C3800991ECC /* RadioButton.swift */, ); path = Views; sourceTree = ""; @@ -858,6 +863,15 @@ path = Strings; sourceTree = ""; }; + D2B18B7D236090D500A9AEDC /* BaseClasses */ = { + isa = PBXGroup; + children = ( + D2B18B7E2360913400A9AEDC /* Control.swift */, + D2B18B802360945C00A9AEDC /* View.swift */, + ); + path = BaseClasses; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -1033,6 +1047,7 @@ D282AAB4223FDDAE00C46919 /* MFLoadImageView.swift in Sources */, D29DF11721E6805F003B2FB9 /* UIColor+MFConvenience.m in Sources */, D29DF25321E6A177003B2FB9 /* MFDigitTextField.m in Sources */, + D2B18B7F2360913400A9AEDC /* Control.swift in Sources */, D29DF12F21E6851E003B2FB9 /* MVMCoreUITopAlertMainView.m in Sources */, DBC4392122491730001AB423 /* LabelWithInternalButton.swift in Sources */, D224798C231450C8003FCCF9 /* HeadlineBodySwitch.swift in Sources */, @@ -1059,6 +1074,7 @@ D28B4F8B21FF967C00712C7A /* MVMCoreUIObject.m in Sources */, 0A1B4A96233BB18F005B3FB4 /* CheckboxWithLabelView.swift in Sources */, D260D7B222D65BDD007E7233 /* MVMCoreUIPageControl.m in Sources */, + D2B18B812360945C00A9AEDC /* View.swift in Sources */, D29DF26D21E6AA0B003B2FB9 /* FLAnimatedImageView.m in Sources */, D29DF2EF21ECEAE1003B2FB9 /* MFFonts.m in Sources */, D22479942316AE5E003FCCF9 /* NSLayoutConstraintExtension.swift in Sources */, diff --git a/MVMCoreUI/Molecules/RadioButton.swift b/MVMCoreUI/Atoms/Views/RadioButton.swift similarity index 78% rename from MVMCoreUI/Molecules/RadioButton.swift rename to MVMCoreUI/Atoms/Views/RadioButton.swift index 059bc5b6..5b0d0c00 100644 --- a/MVMCoreUI/Molecules/RadioButton.swift +++ b/MVMCoreUI/Atoms/Views/RadioButton.swift @@ -8,9 +8,12 @@ import UIKit -@objcMembers open class RadioButton: ViewConstrainingView, FormValidationFormFieldProtocol { +@objcMembers public class RadioButton: Control, FormValidationFormFieldProtocol { + + var diameter = 30 + var enabledColor = UIColor.black + var disabledColor = UIColor.mfSilver() - public let radioButton = MFRadioButton() var delegateObject: MVMCoreUIDelegateObject? var fieldKey: String? @@ -32,50 +35,25 @@ import UIKit } }() + open override func draw(_ rect: CGRect) { + guard let context = UIGraphicsGetCurrentContext() else { return } + context.addEllipse(in: CGRect(x: bounds.width*0.2, y: bounds.height*0.2, width: bounds.width*0.6, height: bounds.height*0.6)) + context.setFillColor(isUserInteractionEnabled ? enabledColor.cgColor : disabledColor.cgColor) + context.fillPath() + } + // MARK: - Inits - public init() { - super.init(frame: .zero) - } - - public override init(frame: CGRect) { - super.init(frame: frame) - } - - required public init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - } - - open override func setupView() { - super.setupView() - guard subviews.count == 0 else { - return - } - - translatesAutoresizingMaskIntoConstraints = false - radioButton.translatesAutoresizingMaskIntoConstraints = false - addSubview(radioButton) - - isAccessibilityElement = true - accessibilityTraits = .none - accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "radio_action_hint") - NSLayoutConstraint.constraintPinSubview(toSuperview: radioButton) - - radioButton.performActionForCheck = { [weak self] in - self?.tapAction() - } - } - func tapAction() { if let radioButtonModel = radioButtonModel { radioButtonModel.selected(self) } else { - radioButton.isSelected = !radioButton.isSelected + isSelected = !isSelected } FormValidator.enableByValidationWith(delegate: delegateObject?.formValidationProtocol) } public func isValidField() -> Bool { - return radioButton.isSelected + return isSelected } public func formFieldName() -> String? { @@ -87,7 +65,27 @@ import UIKit } public func formFieldValue() -> Any? { - return radioButton.isSelected + return isSelected + } + +// MARK: - MVMViewProtocol + open override func setupView() { + super.setupView() + guard subviews.count == 0 else { + return + } + + /*translatesAutoresizingMaskIntoConstraints = false + addSubview(radioButton) + + isAccessibilityElement = true + accessibilityTraits = .none + accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "radio_action_hint") + NSLayoutConstraint.constraintPinSubview(toSuperview: radioButton) + + radioButton.performActionForCheck = { [weak self] in + self?.tapAction() + }*/ } } diff --git a/MVMCoreUI/BaseClasses/Control.swift b/MVMCoreUI/BaseClasses/Control.swift new file mode 100644 index 00000000..bad1a6c8 --- /dev/null +++ b/MVMCoreUI/BaseClasses/Control.swift @@ -0,0 +1,52 @@ +// +// Control.swift +// MVMCoreUI +// +// Created by Scott Pfeil on 10/23/19. +// Copyright © 2019 Verizon Wireless. All rights reserved. +// + +import UIKit + +public class Control: UIControl { + var json: [AnyHashable: Any]? + + public override init(frame: CGRect) { + super.init(frame: .zero) + setupView() + } + + init() { + super.init(frame: .zero) + setupView() + } + + public required init?(coder: NSCoder) { + super.init(coder: coder) + setupView() + } +} + +extension Control: MVMCoreViewProtocol { + public func updateView(_ size: CGFloat) { + } + + public func setupView() { + translatesAutoresizingMaskIntoConstraints = false + insetsLayoutMarginsFromSafeArea = false + } +} + +extension Control: MVMCoreUIMoleculeViewProtocol { + public func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) { + self.json = json + + if let backgroundColorString = json?.optionalStringForKey(KeyBackgroundColor) { + backgroundColor = UIColor.mfGet(forHex: backgroundColorString) + } + } + + public func reset() { + backgroundColor = .clear + } +} diff --git a/MVMCoreUI/BaseClasses/View.swift b/MVMCoreUI/BaseClasses/View.swift new file mode 100644 index 00000000..25b750b0 --- /dev/null +++ b/MVMCoreUI/BaseClasses/View.swift @@ -0,0 +1,52 @@ +// +// View.swift +// MVMCoreUI +// +// Created by Scott Pfeil on 10/23/19. +// Copyright © 2019 Verizon Wireless. All rights reserved. +// + +import UIKit + +public class View: UIView { + var json: [AnyHashable: Any]? + + public override init(frame: CGRect) { + super.init(frame: .zero) + setupView() + } + + init() { + super.init(frame: .zero) + setupView() + } + + public required init?(coder: NSCoder) { + super.init(coder: coder) + setupView() + } +} + +extension View: MVMCoreViewProtocol { + public func updateView(_ size: CGFloat) { + } + + public func setupView() { + translatesAutoresizingMaskIntoConstraints = false + insetsLayoutMarginsFromSafeArea = false + } +} + +extension View: MVMCoreUIMoleculeViewProtocol { + public func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) { + self.json = json + + if let backgroundColorString = json?.optionalStringForKey(KeyBackgroundColor) { + backgroundColor = UIColor.mfGet(forHex: backgroundColorString) + } + } + + public func reset() { + backgroundColor = .clear + } +} diff --git a/MVMCoreUI/Molecules/RadioButtonModel.swift b/MVMCoreUI/Molecules/RadioButtonModel.swift index a72bd889..e2e6b27b 100644 --- a/MVMCoreUI/Molecules/RadioButtonModel.swift +++ b/MVMCoreUI/Molecules/RadioButtonModel.swift @@ -27,9 +27,9 @@ import UIKit } public func selected(_ radioButton: RadioButton) { - selectedRadioButton?.radioButton.isSelected = false + selectedRadioButton?.isSelected = false selectedRadioButton = radioButton - selectedRadioButton?.radioButton.isSelected = true + selectedRadioButton?.isSelected = true } } diff --git a/MVMCoreUI/Molecules/RadioButtonWithLabel.swift b/MVMCoreUI/Molecules/RadioButtonWithLabel.swift index 3dc5f6e5..4f42067a 100644 --- a/MVMCoreUI/Molecules/RadioButtonWithLabel.swift +++ b/MVMCoreUI/Molecules/RadioButtonWithLabel.swift @@ -8,7 +8,7 @@ import UIKit -@objcMembers open class RadioButtonWithLabel: ViewConstrainingView { +@objcMembers public class RadioButtonWithLabel: ViewConstrainingView { public let radioButton = RadioButton() var delegateObject: MVMCoreUIDelegateObject? @@ -108,7 +108,7 @@ extension RadioButtonWithLabel { // MARK: Accessibility extension RadioButtonWithLabel { func changeAccessibilityLabel() { - let stateString = radioButton.radioButton.isSelected ? "radio_selected_state" : "radio_not_selected_state" + let stateString = radioButton.isSelected ? "radio_selected_state" : "radio_not_selected_state" let localizedStringState = MVMCoreUIUtility.hardcodedString(withKey: stateString) ?? "" let accebilityString = (label.accessibilityLabel ?? (json?.optionalStringForKey("accessibilityText") ?? "")) + (MVMCoreUIUtility.hardcodedString(withKey: "radio_desc_state") ?? "") + localizedStringState From 0b364fa004d0e885dd1c81dc3ba602e999cfcfb0 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 23 Oct 2019 11:32:34 -0400 Subject: [PATCH 2/3] Radio button changes --- MVMCoreUI/Atoms/Views/RadioButton.swift | 55 +++++++++++++------- MVMCoreUI/Atoms/Views/ViewConstrainingView.m | 12 ++--- MVMCoreUI/BaseClasses/Control.swift | 16 ++++-- MVMCoreUI/BaseClasses/View.swift | 38 +++++++++----- 4 files changed, 77 insertions(+), 44 deletions(-) diff --git a/MVMCoreUI/Atoms/Views/RadioButton.swift b/MVMCoreUI/Atoms/Views/RadioButton.swift index 5b0d0c00..6347a862 100644 --- a/MVMCoreUI/Atoms/Views/RadioButton.swift +++ b/MVMCoreUI/Atoms/Views/RadioButton.swift @@ -10,7 +10,11 @@ import UIKit @objcMembers public class RadioButton: Control, FormValidationFormFieldProtocol { - var diameter = 30 + var diameter: CGFloat = 30 { + didSet { + widthConstraint?.constant = diameter + } + } var enabledColor = UIColor.black var disabledColor = UIColor.mfSilver() @@ -19,6 +23,9 @@ import UIKit var fieldKey: String? var formValue: Bool? var isRequired: Bool = false + + var widthConstraint: NSLayoutConstraint? + var heightConstraint: NSLayoutConstraint? lazy var radioGroupName: String? = { [unowned self] in @@ -37,12 +44,19 @@ import UIKit open override func draw(_ rect: CGRect) { guard let context = UIGraphicsGetCurrentContext() else { return } - context.addEllipse(in: CGRect(x: bounds.width*0.2, y: bounds.height*0.2, width: bounds.width*0.6, height: bounds.height*0.6)) - context.setFillColor(isUserInteractionEnabled ? enabledColor.cgColor : disabledColor.cgColor) - context.fillPath() + let color = isEnabled ? enabledColor.cgColor : disabledColor.cgColor + layer.cornerRadius = bounds.width * 0.5 + layer.borderColor = color + layer.borderWidth = bounds.width * 0.0333 + if isSelected { + // Space around inner circle is 1/5 the size + context.addEllipse(in: CGRect(x: bounds.width*0.2, y: bounds.height*0.2, width: bounds.width*0.6, height: bounds.height*0.6)) + context.setFillColor(color) + context.fillPath() + } } - // MARK: - Inits + /// The action performed when tapped. func tapAction() { if let radioButtonModel = radioButtonModel { radioButtonModel.selected(self) @@ -71,21 +85,24 @@ import UIKit // MARK: - MVMViewProtocol open override func setupView() { super.setupView() - guard subviews.count == 0 else { - return - } - - /*translatesAutoresizingMaskIntoConstraints = false - addSubview(radioButton) - - isAccessibilityElement = true - accessibilityTraits = .none - accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "radio_action_hint") - NSLayoutConstraint.constraintPinSubview(toSuperview: radioButton) - radioButton.performActionForCheck = { [weak self] in - self?.tapAction() - }*/ + clipsToBounds = true + widthConstraint = widthAnchor.constraint(equalToConstant: 30) + widthConstraint?.isActive = true + heightConstraint = heightAnchor.constraint(equalTo: widthAnchor, multiplier: 1) + heightConstraint?.isActive = true + + addTarget(self, action: #selector(tapAction), for: .touchUpInside) + isAccessibilityElement = true + accessibilityTraits = .button + accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "radio_action_hint") + } +} + +// MARK: - MVMCoreUIViewConstrainingProtocol +extension RadioButton: MVMCoreUIViewConstrainingProtocol { + public func needsToBeConstrained() -> Bool { + return true } } diff --git a/MVMCoreUI/Atoms/Views/ViewConstrainingView.m b/MVMCoreUI/Atoms/Views/ViewConstrainingView.m index 66a3a83d..c6b1023e 100644 --- a/MVMCoreUI/Atoms/Views/ViewConstrainingView.m +++ b/MVMCoreUI/Atoms/Views/ViewConstrainingView.m @@ -314,14 +314,10 @@ [self.molecule updateView:size]; [MFStyler setMarginsForView:self size:size defaultHorizontal:self.updateViewHorizontalDefaults top:(self.updateViewVerticalDefaults ? self.topMarginPadding : 0) bottom:(self.updateViewVerticalDefaults ? self.bottomMarginPadding : 0)]; UIEdgeInsets margins = [MVMCoreUIUtility getMarginsForView:self]; - if (self.updateViewHorizontalDefaults) { - [self setLeftPinConstant:margins.left]; - [self setRightPinConstant:margins.right]; - } - if (self.updateViewVerticalDefaults) { - [self setTopPinConstant:margins.top]; - [self setBottomPinConstant:margins.bottom]; - } + [self setLeftPinConstant:margins.left]; + [self setRightPinConstant:margins.right]; + [self setTopPinConstant:margins.top]; + [self setBottomPinConstant:margins.bottom]; } #pragma mark - MVMCoreUIMoleculeViewProtocol diff --git a/MVMCoreUI/BaseClasses/Control.swift b/MVMCoreUI/BaseClasses/Control.swift index bad1a6c8..fdf8204f 100644 --- a/MVMCoreUI/BaseClasses/Control.swift +++ b/MVMCoreUI/BaseClasses/Control.swift @@ -10,20 +10,29 @@ import UIKit public class Control: UIControl { var json: [AnyHashable: Any]? + + private var initialSetupPerformed = false public override init(frame: CGRect) { super.init(frame: .zero) - setupView() + initialSetup() } init() { super.init(frame: .zero) - setupView() + initialSetup() } public required init?(coder: NSCoder) { super.init(coder: coder) - setupView() + initialSetup() + } + + public func initialSetup() { + if !initialSetupPerformed { + initialSetupPerformed = true + setupView() + } } } @@ -31,6 +40,7 @@ extension Control: MVMCoreViewProtocol { public func updateView(_ size: CGFloat) { } + /// Will be called only once. public func setupView() { translatesAutoresizingMaskIntoConstraints = false insetsLayoutMarginsFromSafeArea = false diff --git a/MVMCoreUI/BaseClasses/View.swift b/MVMCoreUI/BaseClasses/View.swift index 25b750b0..735243df 100644 --- a/MVMCoreUI/BaseClasses/View.swift +++ b/MVMCoreUI/BaseClasses/View.swift @@ -11,26 +11,36 @@ import UIKit public class View: UIView { var json: [AnyHashable: Any]? - public override init(frame: CGRect) { - super.init(frame: .zero) - setupView() - } + private var initialSetupPerformed = false - init() { - super.init(frame: .zero) - setupView() + public override init(frame: CGRect) { + super.init(frame: .zero) + initialSetup() + } + + init() { + super.init(frame: .zero) + initialSetup() + } + + public required init?(coder: NSCoder) { + super.init(coder: coder) + initialSetup() + } + + public func initialSetup() { + if !initialSetupPerformed { + initialSetupPerformed = true + setupView() + } + } } - - public required init?(coder: NSCoder) { - super.init(coder: coder) - setupView() - } -} extension View: MVMCoreViewProtocol { public func updateView(_ size: CGFloat) { } - + + /// Will be called only once. public func setupView() { translatesAutoresizingMaskIntoConstraints = false insetsLayoutMarginsFromSafeArea = false From 0cc81c3255bc542673fc43096f56de80bbac2c3a Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 23 Oct 2019 11:38:15 -0400 Subject: [PATCH 3/3] default background color --- MVMCoreUI/Atoms/Views/RadioButton.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Atoms/Views/RadioButton.swift b/MVMCoreUI/Atoms/Views/RadioButton.swift index 6347a862..23588a4c 100644 --- a/MVMCoreUI/Atoms/Views/RadioButton.swift +++ b/MVMCoreUI/Atoms/Views/RadioButton.swift @@ -64,6 +64,7 @@ import UIKit isSelected = !isSelected } FormValidator.enableByValidationWith(delegate: delegateObject?.formValidationProtocol) + setNeedsDisplay() } public func isValidField() -> Bool { @@ -85,7 +86,7 @@ import UIKit // MARK: - MVMViewProtocol open override func setupView() { super.setupView() - + backgroundColor = .white clipsToBounds = true widthConstraint = widthAnchor.constraint(equalToConstant: 30) widthConstraint?.isActive = true @@ -126,4 +127,9 @@ extension RadioButton { formValidator: delegateObject?.formValidationProtocol?.formValidatorModel?()) FormValidator.setupValidation(molecule: radioButtonModel, delegate: delegateObject?.formValidationProtocol) } + + public override func reset() { + super.reset() + backgroundColor = .white + } }