Fix for the reset() issue with default properties being reset for buttonGroup
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
558a3d7c55
commit
33dc411743
@ -31,21 +31,25 @@ import VDS
|
||||
isAccessibilityElement = false
|
||||
addSubview(buttonGroup)
|
||||
buttonGroup.pinToSuperView()
|
||||
heightConstraint = height(constant: VDS.Button.Size.large.height, priority: .required)
|
||||
}
|
||||
|
||||
open override func setDefaults() {
|
||||
super.setDefaults()
|
||||
buttonGroup.alignment = .center
|
||||
buttonGroup.rowQuantityPhone = 2
|
||||
buttonGroup.rowQuantityTablet = 2
|
||||
heightConstraint = height(constant: VDS.Button.Size.large.height, priority: .required)
|
||||
}
|
||||
|
||||
open override func reset() {
|
||||
buttonGroup.reset()
|
||||
super.reset()
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - MoleculeViewProtocol
|
||||
//--------------------------------------------------
|
||||
|
||||
open override func reset() {
|
||||
super.reset()
|
||||
buttonGroup.reset()
|
||||
}
|
||||
|
||||
public static func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||
guard let model = model as? TwoButtonViewModel,
|
||||
let buttonModel = model.primaryButton ?? model.secondaryButton
|
||||
@ -54,6 +58,9 @@ import VDS
|
||||
return PillButton.estimatedHeight(with: buttonModel, delegateObject)
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - VDSMoleculeViewProtocol
|
||||
//--------------------------------------------------
|
||||
public func viewModelDidUpdate() {
|
||||
var buttons = [PillButton]()
|
||||
if let secondaryModel = viewModel.secondaryButton {
|
||||
@ -87,7 +94,5 @@ import VDS
|
||||
// MARK: - MVMCoreViewProtocol
|
||||
//--------------------------------------------------
|
||||
|
||||
public func updateView(_ size: CGFloat) {
|
||||
setNeedsUpdate()
|
||||
}
|
||||
public func updateView(_ size: CGFloat) {}
|
||||
}
|
||||
|
||||
@ -32,21 +32,20 @@ import VDS
|
||||
isAccessibilityElement = false
|
||||
addSubview(buttonGroup)
|
||||
buttonGroup.pinToSuperView()
|
||||
}
|
||||
|
||||
open override func setDefaults() {
|
||||
super.setDefaults()
|
||||
buttonGroup.alignment = .center
|
||||
buttonGroup.rowQuantityPhone = 2
|
||||
buttonGroup.rowQuantityTablet = 2
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - MVMCoreViewProtocol
|
||||
//--------------------------------------------------
|
||||
open override func reset() {
|
||||
super.reset()
|
||||
buttonGroup.reset()
|
||||
super.reset()
|
||||
}
|
||||
|
||||
open func updateView(_ size: CGFloat) { }
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Stack Manipulation
|
||||
//--------------------------------------------------
|
||||
@ -90,6 +89,7 @@ import VDS
|
||||
//--------------------------------------------------
|
||||
// MARK: - MoleculeViewProtocol
|
||||
//--------------------------------------------------
|
||||
open func updateView(_ size: CGFloat) { }
|
||||
|
||||
public static func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||
guard let model = model as? TwoButtonViewModel,
|
||||
@ -99,6 +99,9 @@ import VDS
|
||||
return PillButton.estimatedHeight(with: buttonModel, delegateObject)
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - VDSMoleculeViewProtocol
|
||||
//--------------------------------------------------
|
||||
public func viewModelDidUpdate() {
|
||||
buttons.removeAll()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user