Code changes

This commit is contained in:
Arora, Prateek 2020-01-09 22:25:53 +05:30
parent 20f62ce4c5
commit b037d23adb

View File

@ -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)