reivew
This commit is contained in:
parent
fcb377df33
commit
4ef662d1ca
@ -16,13 +16,22 @@ import UIKit
|
|||||||
var fieldKey: String?
|
var fieldKey: String?
|
||||||
var formValue: Bool?
|
var formValue: Bool?
|
||||||
var isRequired: Bool = false
|
var isRequired: Bool = false
|
||||||
var radioButtonModel: RadioButtonModel?
|
|
||||||
|
|
||||||
lazy var radioGroupName: String? = {
|
lazy var radioGroupName: String? = {
|
||||||
[unowned self] in
|
[unowned self] in
|
||||||
return json?.optionalStringForKey("radioGroupName") ?? json?.optionalStringForKey("fieldKey")
|
return json?.optionalStringForKey("radioGroupName") ?? json?.optionalStringForKey("fieldKey")
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
lazy var radioButtonModel: RadioButtonModel? = {
|
||||||
|
[unowned self] in
|
||||||
|
if let radioGroupName = radioGroupName,
|
||||||
|
let radioButtonModel = delegateObject?.formValidationProtocol?.formValidatorModel?()?.radioButtonsModelByGroup[radioGroupName] {
|
||||||
|
return radioButtonModel
|
||||||
|
} else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
// MARK: - Inits
|
// MARK: - Inits
|
||||||
public init() {
|
public init() {
|
||||||
super.init(frame: .zero)
|
super.init(frame: .zero)
|
||||||
@ -101,6 +110,5 @@ extension RadioButton {
|
|||||||
let radioButtonModel = RadioButtonModel.setupForRadioButtonGroup(radioButton: self,
|
let radioButtonModel = RadioButtonModel.setupForRadioButtonGroup(radioButton: self,
|
||||||
formValidator: delegateObject?.formValidationProtocol?.formValidatorModel?())
|
formValidator: delegateObject?.formValidationProtocol?.formValidatorModel?())
|
||||||
FormValidator.setupValidation(molecule: radioButtonModel, delegate: delegateObject?.formValidationProtocol)
|
FormValidator.setupValidation(molecule: radioButtonModel, delegate: delegateObject?.formValidationProtocol)
|
||||||
self.radioButtonModel = radioButtonModel
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user