diff --git a/MVMCoreUI/Molecules/RadioButton.swift b/MVMCoreUI/Molecules/RadioButton.swift index c66bdedd..d5cc4d87 100644 --- a/MVMCoreUI/Molecules/RadioButton.swift +++ b/MVMCoreUI/Molecules/RadioButton.swift @@ -11,10 +11,10 @@ import UIKit @objcMembers open class RadioButton: ViewConstrainingView { - var selectedRadioButton: MFRadioButton? let radioButton = MFRadioButton() let label = Label() var target: RadioButtonListProtocol? + var dummyButton: MFCustomButton? // MARK: - Inits public init() { @@ -59,7 +59,12 @@ import UIKit func addActionHandler() { + if dummyButton != nil { + return + } + let dummyButton = MFCustomButton(frame: .zero) + self.dummyButton = dummyButton dummyButton.translatesAutoresizingMaskIntoConstraints = false addSubview(dummyButton) NSLayoutConstraint.constraintPinSubview(toSuperview: dummyButton) diff --git a/MVMCoreUI/Molecules/RadioButtonList.swift b/MVMCoreUI/Molecules/RadioButtonList.swift index fdfbd00a..6a1083fd 100644 --- a/MVMCoreUI/Molecules/RadioButtonList.swift +++ b/MVMCoreUI/Molecules/RadioButtonList.swift @@ -79,6 +79,9 @@ extension RadioButtonList { } setupFormValidation(delegateObject: delegateObject) + + StackableViewController.remove(self.subviews) + var items:[UIView] = [] for option in optionsList { let radioButton = RadioButton(target: self) @@ -86,7 +89,7 @@ extension RadioButtonList { items.append(radioButton) } - let verticalSpace = MFStyler.defaultVerticalPadding(forSize: MVMCoreUIUtility.getWidth()) + let verticalSpace = MFStyler.defaultVerticalPaddingForApplicationWidth() StackableViewController.populateView(self, withUIArray: items) { (item) -> UIEdgeInsets in return UIEdgeInsets(top: verticalSpace,