initialisation changes
This commit is contained in:
parent
dde32fd6a4
commit
f3370d6ec6
@ -14,24 +14,18 @@
|
||||
public let leftImage = LoadImageView()
|
||||
public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink()
|
||||
public let rightLabel = Label(fontStyle: .RegularBodySmall)
|
||||
public let rightLabelStackItem: StackItem
|
||||
public var stack: Stack<StackModel>
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializers
|
||||
//--------------------------------------------------
|
||||
public lazy var rightLabelStackItem: StackItem = {
|
||||
return StackItem(andContain: rightLabel)
|
||||
}()
|
||||
|
||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
rightLabelStackItem = StackItem(andContain: rightLabel)
|
||||
let stackItems = [StackItem(andContain: leftImage), StackItem(andContain: eyebrowHeadlineBodyLink), rightLabelStackItem]
|
||||
let stackModel = StackModel(molecules: [StackItemModel(horizontalAlignment: .fill), StackItemModel(horizontalAlignment: .fill), StackItemModel(horizontalAlignment: .fill)], axis: .horizontal)
|
||||
stack = Stack<StackModel>(with: stackModel, stackItems: stackItems)
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
}
|
||||
|
||||
public required init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
public lazy var stack: Stack<StackModel> = {
|
||||
return Stack<StackModel>.createStack(with: [
|
||||
(view: leftImage, model: StackItemModel(horizontalAlignment: .fill)),
|
||||
(view: eyebrowHeadlineBodyLink, model: StackItemModel(horizontalAlignment: .fill)),
|
||||
(view: rightLabelStackItem, model: StackItemModel(horizontalAlignment: .fill,verticalAlignment: .top))],
|
||||
axis: .horizontal)
|
||||
}()
|
||||
|
||||
open override func alignAccessoryToHero() -> CGPoint? {
|
||||
// Ensures that the right label is centered vertically with headline.
|
||||
|
||||
@ -26,7 +26,7 @@ public class ListLeftVariableIconWithRightCaretAllTextLinksModel: ListItemModel,
|
||||
image.width = 30
|
||||
image.height = 30
|
||||
}
|
||||
eyebrowHeadlineBodyLink.headline?.hero = 0
|
||||
rightLabel.hero = 0
|
||||
}
|
||||
|
||||
//-----------------------------------------------------
|
||||
|
||||
Loading…
Reference in New Issue
Block a user