code review
This commit is contained in:
parent
24ab8f5ece
commit
312bc0b868
@ -11,10 +11,10 @@ import UIKit
|
|||||||
|
|
||||||
@objcMembers open class RadioButton: ViewConstrainingView {
|
@objcMembers open class RadioButton: ViewConstrainingView {
|
||||||
|
|
||||||
var selectedRadioButton: MFRadioButton?
|
|
||||||
let radioButton = MFRadioButton()
|
let radioButton = MFRadioButton()
|
||||||
let label = Label()
|
let label = Label()
|
||||||
var target: RadioButtonListProtocol?
|
var target: RadioButtonListProtocol?
|
||||||
|
var dummyButton: MFCustomButton?
|
||||||
|
|
||||||
// MARK: - Inits
|
// MARK: - Inits
|
||||||
public init() {
|
public init() {
|
||||||
@ -59,7 +59,12 @@ import UIKit
|
|||||||
|
|
||||||
func addActionHandler() {
|
func addActionHandler() {
|
||||||
|
|
||||||
|
if dummyButton != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
let dummyButton = MFCustomButton(frame: .zero)
|
let dummyButton = MFCustomButton(frame: .zero)
|
||||||
|
self.dummyButton = dummyButton
|
||||||
dummyButton.translatesAutoresizingMaskIntoConstraints = false
|
dummyButton.translatesAutoresizingMaskIntoConstraints = false
|
||||||
addSubview(dummyButton)
|
addSubview(dummyButton)
|
||||||
NSLayoutConstraint.constraintPinSubview(toSuperview: dummyButton)
|
NSLayoutConstraint.constraintPinSubview(toSuperview: dummyButton)
|
||||||
|
|||||||
@ -79,6 +79,9 @@ extension RadioButtonList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setupFormValidation(delegateObject: delegateObject)
|
setupFormValidation(delegateObject: delegateObject)
|
||||||
|
|
||||||
|
StackableViewController.remove(self.subviews)
|
||||||
|
|
||||||
var items:[UIView] = []
|
var items:[UIView] = []
|
||||||
for option in optionsList {
|
for option in optionsList {
|
||||||
let radioButton = RadioButton(target: self)
|
let radioButton = RadioButton(target: self)
|
||||||
@ -86,7 +89,7 @@ extension RadioButtonList {
|
|||||||
items.append(radioButton)
|
items.append(radioButton)
|
||||||
}
|
}
|
||||||
|
|
||||||
let verticalSpace = MFStyler.defaultVerticalPadding(forSize: MVMCoreUIUtility.getWidth())
|
let verticalSpace = MFStyler.defaultVerticalPaddingForApplicationWidth()
|
||||||
StackableViewController.populateView(self,
|
StackableViewController.populateView(self,
|
||||||
withUIArray: items) { (item) -> UIEdgeInsets in
|
withUIArray: items) { (item) -> UIEdgeInsets in
|
||||||
return UIEdgeInsets(top: verticalSpace,
|
return UIEdgeInsets(top: verticalSpace,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user