Skip to content

Commit a776584

Browse files
improve countdown docs
1 parent 7128163 commit a776584

File tree

3 files changed

+23
-21
lines changed

3 files changed

+23
-21
lines changed

Sources/ComponentsKit/Components/Countdown/Models/CountdownVM.swift

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@ public struct CountdownVM: ComponentVM {
55
/// The color of the countdown.
66
public var color: ComponentColor?
77

8+
/// The locale used for localizing the countdown.
9+
public var locale: Locale = .current
10+
11+
/// A dictionary containing localized representations of time units (days, hours, minutes, seconds) for various locales.
12+
///
13+
/// This property can be used to override the default localizations for supported languages or to add
14+
/// localizations for unsupported languages. By default, the library provides strings for the following locales:
15+
/// - English ("en")
16+
/// - Spanish ("es")
17+
/// - French ("fr")
18+
/// - German ("de")
19+
/// - Chinese ("zh")
20+
/// - Japanese ("ja")
21+
/// - Russian ("ru")
22+
/// - Arabic ("ar")
23+
/// - Hindi ("hi")
24+
/// - Portuguese ("pt")
25+
public var localization: [Locale: UnitsLocalization] = [:]
26+
827
/// The font used for displaying the countdown numbers and trailing units.
928
public var mainFont: UniversalFont?
1029

@@ -29,25 +48,6 @@ public struct CountdownVM: ComponentVM {
2948
/// The target date until which the countdown runs.
3049
public var until: Date = Date().addingTimeInterval(3600 * 85)
3150

32-
/// The locale used for localizing the countdown.
33-
public var locale: Locale = .current
34-
35-
/// A dictionary containing localized representations of time units (days, hours, minutes, seconds) for various locales.
36-
///
37-
/// This property can be used to override the default localizations for supported languages or to add
38-
/// localizations for unsupported languages. By default, the library provides strings for the following locales:
39-
/// - English ("en")
40-
/// - Spanish ("es")
41-
/// - French ("fr")
42-
/// - German ("de")
43-
/// - Chinese ("zh")
44-
/// - Japanese ("ja")
45-
/// - Russian ("ru")
46-
/// - Arabic ("ar")
47-
/// - Hindi ("hi")
48-
/// - Portuguese ("pt")
49-
public var localization: [Locale: UnitsLocalization] = [:]
50-
5151
/// Initializes a new instance of `CountdownVM` with default values.
5252
public init() {}
5353
}

Sources/ComponentsKit/Components/Countdown/SUCountdown.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import SwiftUI
22

3-
/// A SwiftUI component that displays a countdown.
3+
/// A SwiftUI timer component that counts down from a specified duration to zero.
44
public struct SUCountdown: View {
55
// MARK: - Properties
66

Sources/ComponentsKit/Components/Countdown/UKCountdown.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import AutoLayout
22
import Combine
33
import UIKit
44

5-
/// A UIKit component that displays a countdown.
5+
/// A UIKit timer component that counts down from a specified duration to zero.
66
public class UKCountdown: UIView, UKComponent {
77
// MARK: - Public Properties
88

@@ -13,6 +13,8 @@ public class UKCountdown: UIView, UKComponent {
1313
}
1414
}
1515

16+
// MARK: - Subviews
17+
1618
/// The main container stack view containing all time labels and colon labels.
1719
public let stackView = UIStackView()
1820

0 commit comments

Comments
 (0)