Countdown

A timer component that counts down from a specified duration to zero.

Preview

Button Preview

Code Example

let model = CountdownVM {
  $0.until = .now.addingTimeInterval(3600 * 85)
  $0.style = .light
  $0.unitsStyle = .bottom
  $0.color = .danger
  $0.locale = Locale(identifier: "es")
}

API

CountdownVM Props

A model that defines the appearance properties for a countdown component.

NameTypeDefaultDescription
colorComponentColoraccentThe color of the countdown.
localeLocalecurrentThe locale used for localizing the countdown.
localization[Locale: UnitsLocalization][:]A dictionary containing localized representations of time units (days, hours, minutes, seconds) for various locales.
mainFontUniversalFont?nilThe font used for displaying the countdown numbers and trailing units.
secondaryFontUniversalFont?nilThe font used for displaying the countdown bottom units.
sizeComponentSizemediumThe predefined size of the countdown.
styleStylelightThe visual style of the countdown component.
unitsStyleUnitsStylebottomThe visual style of the units.

SUCountdown

public init(model: CountdownVM)

UKCountdown

Initializers

public init(model: CountdownVM)

Public Properties

NameTypeDescription
modelCountdownVMA model that defines the appearance properties.

Public Subviews

NameTypeDescription
stackViewUIStackViewThe main container stack view containing all time labels and colon labels.
daysLabelUILabelA label showing the number of days remaining.
hoursLabelUILabelA label showing the number of hours remaining.
minutesLabelUILabelA label showing the number of minutes remaining.
secondsLabelUILabelA label showing the number of seconds remaining.
colonLabels[UILabel]An array of colon labels used as separators between the time segments (days/hours/minutes/seconds).