updated as per confluence
This commit is contained in:
parent
73403b8948
commit
594a45894e
@ -13,18 +13,18 @@ import Foundation
|
|||||||
// MARK: - Outlets
|
// MARK: - Outlets
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
public var stack: Stack<StackModel>
|
public var stack: Stack<StackModel>
|
||||||
public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(frame: .zero)
|
public let headlineBodyLink = EyebrowHeadlineBodyLink(frame: .zero)
|
||||||
public let rightLabel = Label.commonLabelB2(true)
|
public let rightLabel = Label.commonLabelB2(true)
|
||||||
public let arrow = Arrow(frame: .zero)
|
public let arrow = Arrow(frame: .zero)
|
||||||
let arrowAndrightLabelStack: Stack<StackModel>
|
let arrowAndRightLabelStack: Stack<StackModel>
|
||||||
|
|
||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
arrowAndrightLabelStack = Stack<StackModel>.createStack(with: [(view: arrow, model: StackItemModel(horizontalAlignment: .fill)),
|
arrowAndRightLabelStack = Stack<StackModel>.createStack(with: [(view: arrow, model: StackItemModel(horizontalAlignment: .fill)),
|
||||||
(view: rightLabel, model: StackItemModel(horizontalAlignment: .leading))],
|
(view: rightLabel, model: StackItemModel(horizontalAlignment: .leading))],
|
||||||
axis: .horizontal, spacing: 4)
|
axis: .horizontal, spacing: 6)
|
||||||
stack = Stack<StackModel>.createStack(with: [(view: eyebrowHeadlineBodyLink, model: StackItemModel(percent:70,horizontalAlignment: .leading)),
|
stack = Stack<StackModel>.createStack(with: [(view: headlineBodyLink, model: StackItemModel(percent:70,horizontalAlignment: .leading)),
|
||||||
(view: arrowAndrightLabelStack, model: StackItemModel(percent:30,horizontalAlignment: .trailing,verticalAlignment: .top))],
|
(view: arrowAndRightLabelStack, model: StackItemModel(percent:30,horizontalAlignment: .trailing,verticalAlignment: .top))],
|
||||||
axis: .horizontal)
|
axis: .horizontal)
|
||||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||||
}
|
}
|
||||||
@ -41,14 +41,13 @@ import Foundation
|
|||||||
arrow.pinHeightAndWidth()
|
arrow.pinHeightAndWidth()
|
||||||
addMolecule(stack)
|
addMolecule(stack)
|
||||||
stack.restack()
|
stack.restack()
|
||||||
arrowAndrightLabelStack.restack()
|
arrowAndRightLabelStack.restack()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||||
super.set(with: model, delegateObject, additionalData)
|
super.set(with: model, delegateObject, additionalData)
|
||||||
guard let model = model as? ListRightVariablePriceChangeBodyTextModel else { return }
|
guard let model = model as? ListRightVariablePriceChangeBodyTextModel else { return }
|
||||||
eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData)
|
headlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData)
|
||||||
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
|
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
|
||||||
arrow.set(with: model.arrow, delegateObject, additionalData)
|
arrow.set(with: model.arrow, delegateObject, additionalData)
|
||||||
}
|
}
|
||||||
@ -56,8 +55,9 @@ import Foundation
|
|||||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
return 120
|
return 120
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
rightLabel.styleB2(true)
|
rightLabel.styleB2(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,8 +13,6 @@ public class ListRightVariablePriceChangeBodyTextModel: ListItemModel, MoleculeM
|
|||||||
public var rightLabel: LabelModel
|
public var rightLabel: LabelModel
|
||||||
public var arrow: ArrowModel
|
public var arrow: ArrowModel
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public init(eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel,rightLabel: LabelModel,arrow: ArrowModel) {
|
public init(eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel,rightLabel: LabelModel,arrow: ArrowModel) {
|
||||||
self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink
|
self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink
|
||||||
self.rightLabel = rightLabel
|
self.rightLabel = rightLabel
|
||||||
@ -22,8 +20,6 @@ public class ListRightVariablePriceChangeBodyTextModel: ListItemModel, MoleculeM
|
|||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
case moleculeName
|
case moleculeName
|
||||||
case eyebrowHeadlineBodyLink
|
case eyebrowHeadlineBodyLink
|
||||||
@ -36,7 +32,6 @@ public class ListRightVariablePriceChangeBodyTextModel: ListItemModel, MoleculeM
|
|||||||
eyebrowHeadlineBodyLink = try typeContainer.decode(EyebrowHeadlineBodyLinkModel.self, forKey: .eyebrowHeadlineBodyLink)
|
eyebrowHeadlineBodyLink = try typeContainer.decode(EyebrowHeadlineBodyLinkModel.self, forKey: .eyebrowHeadlineBodyLink)
|
||||||
rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel)
|
rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel)
|
||||||
arrow = try typeContainer.decode(ArrowModel.self, forKey: .arrow)
|
arrow = try typeContainer.decode(ArrowModel.self, forKey: .arrow)
|
||||||
|
|
||||||
try super.init(from: decoder)
|
try super.init(from: decoder)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,6 +42,5 @@ public class ListRightVariablePriceChangeBodyTextModel: ListItemModel, MoleculeM
|
|||||||
try container.encode(eyebrowHeadlineBodyLink, forKey: .eyebrowHeadlineBodyLink)
|
try container.encode(eyebrowHeadlineBodyLink, forKey: .eyebrowHeadlineBodyLink)
|
||||||
try container.encode(rightLabel, forKey: .rightLabel)
|
try container.encode(rightLabel, forKey: .rightLabel)
|
||||||
try container.encode(arrow, forKey: .arrow)
|
try container.encode(arrow, forKey: .arrow)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user