diff --git a/MVMCoreUI/Molecules/HorizontalCombinationViews/TwoButtonView.swift b/MVMCoreUI/Molecules/HorizontalCombinationViews/TwoButtonView.swift index 28ad6dc4..592abb36 100644 --- a/MVMCoreUI/Molecules/HorizontalCombinationViews/TwoButtonView.swift +++ b/MVMCoreUI/Molecules/HorizontalCombinationViews/TwoButtonView.swift @@ -125,6 +125,18 @@ import UIKit } } + open func setupWithSecondaryButton() { + guard self.secondaryButton == nil else { + return + } + createSecondaryButton() + if let secondaryButton = secondaryButton { + addSubview(secondaryButton) + pinView(toSuperView: secondaryButton) + alignCenterHorizontal() + } + } + // Sets up the number of buttons based on the maps. Doesn't set the buttons with the maps because legacy code handles differently from modern code... func setupUI(withPrimaryButtonMap primaryButtonMap: [AnyHashable: Any]?, secondaryButtonMap: [AnyHashable: Any]?, legacy: Bool) { if primaryButtonMap != nil, secondaryButtonMap != nil { @@ -140,6 +152,10 @@ import UIKit removeButtons() setupWithPrimaryButton() } + } else if secondaryButtonMap != nil { + heightConstraint?.isActive = false + removeButtons() + setupWithSecondaryButton() } else { removeButtons() if heightConstraint == nil {