Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ struct CountdownWidthCalculator {
for attributedText: NSAttributedString,
model: CountdownVM
) -> CGFloat {
self.style(label, with: model)
self.style(self.label, with: model)
self.label.attributedText = attributedText

let estimatedSize = self.label.sizeThatFits(UIView.layoutFittingExpandedSize)

return estimatedSize.width
return estimatedSize.width + 2
}

private static func style(_ label: UILabel, with model: CountdownVM) {
label.textAlignment = .center
label.numberOfLines = 0
}
}
6 changes: 3 additions & 3 deletions Sources/ComponentsKit/Components/Countdown/SUCountdown.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public struct SUCountdown: View {
switch (self.model.style, self.model.unitsStyle) {
case (.plain, .bottom):
self.styledTime(value: self.manager.days, unit: .days)
colonView
self.colonView
self.styledTime(value: self.manager.hours, unit: .hours)
colonView
self.colonView
self.styledTime(value: self.manager.minutes, unit: .minutes)
colonView
self.colonView
self.styledTime(value: self.manager.seconds, unit: .seconds)

case (.plain, .hidden), (.plain, .trailing):
Expand Down
Loading