Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui into feature/model_cleanup

This commit is contained in:
Pfeil, Scott Robert 2020-03-25 13:20:08 -04:00
commit 044f607996
3 changed files with 16 additions and 14 deletions

View File

@ -128,9 +128,7 @@ import UIKit
self.delegateObject = delegateObject
isSelected = model.state
let radioButtonModel = RadioButtonSelectionHelper.setupForRadioButtonGroup(model,
formValidator: delegateObject?.formHolderDelegate?.formValidator)
FormValidator.setupValidation(molecule: radioButtonModel, delegate: delegateObject?.formHolderDelegate)
RadioButtonSelectionHelper.setupForRadioButtonGroup(model, self, delegateObject: delegateObject)
}
public override func reset() {

View File

@ -14,7 +14,7 @@ import UIKit
public var fieldKey: String?
public var groupName: String? = FormValidator.defaultGroupName
private var selectedRadioButton: RadioButton?
var selectedRadioButton: RadioButton?
private var fieldGroupName: String?
public var baseValue: AnyHashable?
@ -22,16 +22,20 @@ import UIKit
self.fieldKey = fieldKey
}
public static func setupForRadioButtonGroup(_ radioButtonModel: RadioButtonModel, formValidator: FormValidator?) -> RadioButtonSelectionHelper {
public static func setupForRadioButtonGroup(_ radioButtonModel: RadioButtonModel, _ radioButton: RadioButton, delegateObject: MVMCoreUIDelegateObject?) {
guard let groupName = radioButtonModel.fieldKey,
let formValidator = formValidator else {
return RadioButtonSelectionHelper(radioButtonModel.fieldKey)
let formValidator = delegateObject?.formHolderDelegate?.formValidator else {
return
}
let radioButtonSelectionHelper = formValidator.radioButtonsModelByGroup[groupName] ?? RadioButtonSelectionHelper(radioButtonModel.fieldKey)
let radioButtonSelectionHelper = formValidator.radioButtonsModelByGroup[groupName] ?? RadioButtonSelectionHelper(radioButtonModel.fieldKey)
radioButtonSelectionHelper.fieldGroupName = radioButtonModel.fieldKey
formValidator.radioButtonsModelByGroup[groupName] = radioButtonSelectionHelper
return radioButtonSelectionHelper
if radioButtonModel.state {
radioButtonSelectionHelper.selectedRadioButton = radioButton
}
FormValidator.setupValidation(molecule: radioButtonSelectionHelper, delegate: delegateObject?.formHolderDelegate)
}
public func selected(_ radioButton: RadioButton) {

View File

@ -260,15 +260,15 @@ static const CGFloat VertialShadowOffset = 6;
UIBezierPath *shadowPath = [UIBezierPath bezierPath];
//get the variables for frame
CGFloat x = 0;
CGFloat y = 0;
CGFloat x = rect.origin.x;
CGFloat y = rect.origin.y;
CGFloat width = CGRectGetWidth(rect);
CGFloat height = CGRectGetHeight(rect);
[shadowPath moveToPoint:CGPointMake(x + HorizontalShadowInset, y)];
[shadowPath addLineToPoint:CGPointMake(width - HorizontalShadowInset, y)];
[shadowPath addLineToPoint:CGPointMake(width - HorizontalShadowInset, height-VertialShadowOffset/2)];
[shadowPath addQuadCurveToPoint:CGPointMake(x + HorizontalShadowInset, height - VertialShadowOffset/2) controlPoint:CGPointMake(width/2.f, height - VertialShadowOffset * 1.5)];
[shadowPath addLineToPoint:CGPointMake(x + width - HorizontalShadowInset, y)];
[shadowPath addLineToPoint:CGPointMake(x + width - HorizontalShadowInset, height-VertialShadowOffset/2)];
[shadowPath addQuadCurveToPoint:CGPointMake(x + HorizontalShadowInset, height - VertialShadowOffset/2) controlPoint:CGPointMake((x + width)/2.f, height - VertialShadowOffset * 1.5)];
[shadowPath addLineToPoint:CGPointMake(x + HorizontalShadowInset, y)];
[shadowPath closePath];