fix button order
This commit is contained in:
parent
0d4008dec7
commit
f24485c699
@ -43,8 +43,8 @@ import UIKit
|
||||
|
||||
stack.translatesAutoresizingMaskIntoConstraints = false
|
||||
addSubview(stack)
|
||||
stack.addArrangedSubview(primaryButton)
|
||||
stack.addArrangedSubview(secondaryButton)
|
||||
stack.addArrangedSubview(primaryButton)
|
||||
NSLayoutConstraint.constraintPinSubview(toSuperview: stack)
|
||||
stack.axis = .horizontal
|
||||
stack.spacing = 10
|
||||
@ -107,19 +107,19 @@ import UIKit
|
||||
}
|
||||
|
||||
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
||||
super.setWithModel(model, delegateObject, additionalData)
|
||||
guard let model = model as? TwoButtonViewModel else { return }
|
||||
if let primaryModel = model.primaryButton {
|
||||
showPrimaryButton()
|
||||
primaryButton.setWithModel(primaryModel, delegateObject, additionalData)
|
||||
} else {
|
||||
hidePrimaryButton()
|
||||
}
|
||||
if let secondaryModel = model.secondaryButton {
|
||||
showSecondaryButton()
|
||||
secondaryButton.setWithModel(secondaryModel, delegateObject, additionalData)
|
||||
} else {
|
||||
hideSecondaryButton()
|
||||
}
|
||||
if let primaryModel = model.primaryButton {
|
||||
showPrimaryButton()
|
||||
primaryButton.setWithModel(primaryModel, delegateObject, additionalData)
|
||||
} else {
|
||||
hidePrimaryButton()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user