From dcc8cc0167caa23c73aeeaaf3abbdb6e2f37cee8 Mon Sep 17 00:00:00 2001 From: Subhankar Acharya Date: Tue, 17 Mar 2020 17:34:38 +0530 Subject: [PATCH] code improvement. --- .../RightVariable/ListRightVariableTotalDataCaret.swift | 8 ++++---- .../ListRightVariableTotalDataCaretModel.swift | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift index 0be49a32..eeeb47de 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift @@ -24,10 +24,9 @@ import Foundation public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(horizontalAlignment: .leading)), - (view: bar, model: StackItemModel(horizontalAlignment: .trailing)), - (view: rightLabel, model: StackItemModel(horizontalAlignment: .fill))], + (view: bar, model: StackItemModel(horizontalAlignment: .fill)), + (view: rightLabel, model: StackItemModel(spacing: 4, horizontalAlignment: .fill))], axis: .horizontal) - bar.widthAnchor.constraint(equalToConstant: 20).isActive = true super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -41,8 +40,9 @@ import Foundation override open func setupView() { super.setupView() - rightLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal) bar.setStyle(.heavy) + bar.widthAnchor.constraint(equalToConstant: 20).isActive = true + rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal) addMolecule(stack) } diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift index 6d1ba0c5..50a3e4c9 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift @@ -38,7 +38,6 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc case bar } - required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel) @@ -54,6 +53,5 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc try container.encode(leftLabel, forKey: .leftLabel) try container.encode(rightLabel, forKey: .rightLabel) try container.encode(bar, forKey: .bar) - } }