diff --git a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift index c14e20fc..eab07e0f 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Toggle.swift @@ -135,12 +135,7 @@ public typealias ActionBlockConfirmation = () -> (Bool) knobLeadingConstraint?.isActive = false knobTrailingConstraint?.isActive = false - if isOn { - constrainKnobOn() - - } else { - constrainKnobOff() - } + _ = isOn ? constrainKnobOn() : constrainKnobOff() knobTrailingConstraint?.isActive = true knobLeadingConstraint?.isActive = true @@ -242,7 +237,6 @@ public typealias ActionBlockConfirmation = () -> (Bool) bottomAnchor.constraint(greaterThanOrEqualTo: knobView.bottomAnchor).isActive = true constrainKnobOff() - knobLeadingConstraint?.isActive = true } public override func reset() { diff --git a/MVMCoreUI/Atomic/Molecules/LeftRightViews/ToggleMolecules/LabelToggle.swift b/MVMCoreUI/Atomic/Molecules/LeftRightViews/ToggleMolecules/LabelToggle.swift index 17a645ed..3ff3a41f 100644 --- a/MVMCoreUI/Atomic/Molecules/LeftRightViews/ToggleMolecules/LabelToggle.swift +++ b/MVMCoreUI/Atomic/Molecules/LeftRightViews/ToggleMolecules/LabelToggle.swift @@ -8,6 +8,7 @@ import UIKit + @objcMembers open class LabelToggle: View { //-------------------------------------------------- // MARK: - Properties @@ -38,7 +39,9 @@ import UIKit open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { guard let model = model as? LabelToggleModel, let toggleHeight = Toggle.estimatedHeight(with: model.toggle, delegateObject), - let labelHeight = Label.estimatedHeight(with: model.label, delegateObject) else { return nil } + let labelHeight = Label.estimatedHeight(with: model.label, delegateObject) + else { return nil } + return max(toggleHeight, labelHeight) }