This commit is contained in:
Pfeil, Scott Robert 2020-04-06 11:54:14 -04:00
parent 3ec2150afe
commit a601041c5f
3 changed files with 17 additions and 28 deletions

View File

@ -946,7 +946,6 @@
52267A0623FFE25000906CBA /* ListOneColumnFullWidthTextAllTextAndLinks.swift */,
8D084ACF2410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift */,
8D084AD12410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift */,
8DFB6D89242A134600A3F715 /* ThreeColumn */,
);
path = OneColumn;
sourceTree = "<group>";
@ -998,14 +997,6 @@
path = ThreeColumn;
sourceTree = "<group>";
};
8DFB6D89242A134600A3F715 /* ThreeColumn */ = {
isa = PBXGroup;
children = (
);
name = ThreeColumn;
path = ../ThreeColumn;
sourceTree = "<group>";
};
94C01508242155FE005811A9 /* Actions */ = {
isa = PBXGroup;
children = (

View File

@ -13,21 +13,26 @@ import Foundation
//-----------------------------------------------------
// MARK: - Outlets
//-----------------------------------------------------
var stack: Stack<StackModel>
let leftLabel = Label.createLabelRegularBodySmall(true)
let centerLabel = Label.createLabelRegularBodySmall(true)
let rightLabel = Label.createLabelRegularBodySmall(true)
let arrow = Arrow(frame: .zero)
open var stack: Stack<StackModel>
public let leftLabel = Label.createLabelRegularBodySmall(true)
public let centerLabel = Label.createLabelRegularBodySmall(true)
public let rightLabel = Label.createLabelRegularBodySmall(true)
public let arrow = Arrow(frame: .zero)
public let arrowAndLabel2Stack: Stack<StackModel>
//-----------------------------------------------------
// MARK: - Initializers
//-----------------------------------------------------
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
arrowAndLabel2Stack = Stack<StackModel>.createStack(with: [(view: arrow, model: StackItemModel(horizontalAlignment: .fill)),
(view: centerLabel, model: StackItemModel(horizontalAlignment: .leading))],
axis: .horizontal, spacing: 4)
centerLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal)
centerLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 900), for: .horizontal)
stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 30, horizontalAlignment: .leading)),
(view: arrow, model: StackItemModel(percent: 4, horizontalAlignment: .trailing)),
(view: centerLabel, model: StackItemModel(percent: 46, horizontalAlignment: .leading)),
(view: arrowAndLabel2Stack, model: StackItemModel(percent: 50, horizontalAlignment: .fill)),
(view: rightLabel, model: StackItemModel(percent:20,horizontalAlignment: .leading))],
axis: .horizontal,spacing: 2)
axis: .horizontal)
super.init(style: style, reuseIdentifier: reuseIdentifier)
}
@ -42,6 +47,8 @@ import Foundation
super.setupView()
addMolecule(stack)
arrow.pinHeightAndWidth()
arrowAndLabel2Stack.restack()
stack.restack()
}
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
@ -51,7 +58,6 @@ import Foundation
centerLabel.set(with: model.centerLabel, delegateObject, additionalData)
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
arrow.set(with: model.arrow, delegateObject, additionalData)
stack.restack()
}
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
@ -63,6 +69,5 @@ import Foundation
leftLabel.styleRegularBodySmall(true)
centerLabel.styleRegularBodySmall(true)
rightLabel.styleRegularBodySmall(true)
arrow.reset()
}
}

View File

@ -9,7 +9,6 @@
import Foundation
public class ListThreeColumnInternationalDataModel: ListItemModel, MoleculeModelProtocol {
public static var identifier: String = "list3CIntData"
public var leftLabel: LabelModel
public var centerLabel: LabelModel
@ -24,12 +23,6 @@ public class ListThreeColumnInternationalDataModel: ListItemModel, MoleculeModel
super.init()
}
public override func setDefaults() {
super.setDefaults()
arrow.degrees = 50
arrow.color = Color.init(uiColor: .mvmGreen)
}
private enum CodingKeys: String, CodingKey {
case moleculeName
case leftLabel
@ -47,7 +40,7 @@ public class ListThreeColumnInternationalDataModel: ListItemModel, MoleculeModel
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName)