Code changes after review.

This commit is contained in:
Lekshmi S 2020-10-27 12:33:56 +05:30
parent 9e8580e240
commit 46e0c6281f

View File

@ -12,26 +12,12 @@
//-----------------------------------------------------
public let stars = Stars()
public var reviewsCount = Label(fontStyle: .RegularBodySmall)
public lazy var stack: Stack<StackModel> = {
return Stack<StackModel>.createStack(with: [(view: stars, model: StackItemModel(horizontalAlignment: .fill)),
(view: reviewsCount, model: StackItemModel(horizontalAlignment: .leading))],
axis: .horizontal, spacing: Padding.Two)
}()
//-----------------------------------------------------
// MARK: - Properties
//-----------------------------------------------------
public var stack: Stack<StackModel>
//-----------------------------------------------------
// MARK: - Initializers
//-----------------------------------------------------
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
stack = Stack<StackModel>.createStack(with: [(view: stars, model: StackItemModel(horizontalAlignment: .fill)),
(view: reviewsCount, model: StackItemModel(horizontalAlignment: .leading))],
axis: .horizontal, spacing: 8)
super.init(style: style, reuseIdentifier: reuseIdentifier)
}
public required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
//-----------------------------------------------------
// MARK: - Lifecycle
//-----------------------------------------------------
@ -41,6 +27,11 @@
stack.restack()
}
open override func updateView(_ size: CGFloat) {
super.updateView(size)
stack.updateView(size)
}
//----------------------------------------------------
// MARK: - Molecule
//----------------------------------------------------