diff --git a/MVMCoreUI/Molecules/VerticalCombinationViews/HeadLineBodyCaretLinkImage.swift b/MVMCoreUI/Molecules/VerticalCombinationViews/HeadLineBodyCaretLinkImage.swift index f1695d02..1b1c57e9 100644 --- a/MVMCoreUI/Molecules/VerticalCombinationViews/HeadLineBodyCaretLinkImage.swift +++ b/MVMCoreUI/Molecules/VerticalCombinationViews/HeadLineBodyCaretLinkImage.swift @@ -43,9 +43,12 @@ import Foundation leftConstraintHeadline = headlineBody.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: padding) leftConstraintHeadline?.isActive = true headlineBody.topAnchor.constraint(equalTo: view.topAnchor, constant: PaddingDefault).isActive = true - let headLineBodyWidth = min((MVMCoreUISplitViewController.getDetailViewWidth() * 0.85), maxWidth) - headlineBody.widthAnchor.constraint(lessThanOrEqualToConstant: headLineBodyWidth).isActive = true - + + let headLineBodyWidth = headlineBody.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.85) + headLineBodyWidth.priority = .defaultHigh + headLineBodyWidth.isActive = true + headlineBody.widthAnchor.constraint(lessThanOrEqualToConstant: maxWidth).isActive = true + spaceBetweenViews = caretButton.topAnchor.constraint(greaterThanOrEqualTo: headlineBody.bottomAnchor, constant: spaceBetweenConstant) spaceBetweenViews?.isActive = true @@ -67,16 +70,7 @@ import Foundation NSLayoutConstraint.constraintPinSubview(toSuperview: backgroundImageView) view.sendSubviewToBack(backgroundImageView) } - - // MARK: - Constraining - public func setSpacing() { - if headlineBody.hasText() && (caretButton.titleLabel?.text?.count ?? 0) > 0 { - spaceBetweenViews?.constant = spaceBetweenConstant - } else { - spaceBetweenViews?.constant = 0 - } - } - + // MARK: - MVMCoreUIMoleculeViewProtocol open override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) { super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)