Code changes after review.
This commit is contained in:
parent
9e8580e240
commit
46e0c6281f
@ -12,26 +12,12 @@
|
|||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
public let stars = Stars()
|
public let stars = Stars()
|
||||||
public var reviewsCount = Label(fontStyle: .RegularBodySmall)
|
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
|
// MARK: - Lifecycle
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
@ -41,6 +27,11 @@
|
|||||||
stack.restack()
|
stack.restack()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open override func updateView(_ size: CGFloat) {
|
||||||
|
super.updateView(size)
|
||||||
|
stack.updateView(size)
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
// MARK: - Molecule
|
// MARK: - Molecule
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user