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