diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListStarRating.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListStarRating.swift index b1ca1ac4..2e1ec8cb 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListStarRating.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListStarRating.swift @@ -12,26 +12,12 @@ //----------------------------------------------------- public let stars = Stars() public var reviewsCount = Label(fontStyle: .RegularBodySmall) + public lazy var stack: Stack = { + return Stack.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 - - //----------------------------------------------------- - // MARK: - Initializers - //----------------------------------------------------- - public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - stack = Stack.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 //----------------------------------------------------