From b72f9a2b71186e206df6dfa64d74b9984569b136 Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Tue, 4 Jun 2019 09:43:16 -0400 Subject: [PATCH] code review --- MVMCoreUI/Molecules/RadioButton.swift | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/MVMCoreUI/Molecules/RadioButton.swift b/MVMCoreUI/Molecules/RadioButton.swift index ae2f7d52..90c4fd5e 100644 --- a/MVMCoreUI/Molecules/RadioButton.swift +++ b/MVMCoreUI/Molecules/RadioButton.swift @@ -44,8 +44,9 @@ import UIKit translatesAutoresizingMaskIntoConstraints = false radioButton.translatesAutoresizingMaskIntoConstraints = false addSubview(radioButton) - - radioButton.leftAnchor.constraint(equalTo: leftAnchor, constant: 0).isActive = true + + + radioButton.leftAnchor.constraint(equalTo: layoutMarginsGuide.leftAnchor, constant: 0).isActive = true radioButton.topAnchor.constraint(greaterThanOrEqualTo: topAnchor, constant: PaddingOne).isActive = true bottomAnchor.constraint(greaterThanOrEqualTo: radioButton.bottomAnchor, constant: PaddingOne).isActive = true radioButton.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true @@ -53,7 +54,7 @@ import UIKit if let rightView = createRightView() { addSubview(rightView) rightView.leftAnchor.constraint(equalTo: radioButton.rightAnchor, constant: PaddingHorizontalBetweenRelatedItems).isActive = true - rightView.rightAnchor.constraint(equalTo: rightAnchor, constant: 0).isActive = true + rightView.rightAnchor.constraint(equalTo: layoutMarginsGuide.rightAnchor, constant: 0).isActive = true rightView.topAnchor.constraint(greaterThanOrEqualTo: topAnchor, constant: PaddingOne).isActive = true rightView.bottomAnchor.constraint(greaterThanOrEqualTo: bottomAnchor, constant: PaddingOne).isActive = true rightView.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true @@ -127,14 +128,6 @@ extension RadioButton { delegateObject: delegateObject, additionalData: additionalData) } - - open override func needsToBeConstrained() -> Bool { - return true - } - - open override func moleculeAlignment() -> UIStackView.Alignment { - return UIStackView.Alignment.leading; - } }