diff --git a/Sources/ComponentsKit/Components/Alert/Helpers/AlertButtonsOrientationCalculator.swift b/Sources/ComponentsKit/Components/Alert/Helpers/AlertButtonsOrientationCalculator.swift index 3312394f..e12bb3e4 100644 --- a/Sources/ComponentsKit/Components/Alert/Helpers/AlertButtonsOrientationCalculator.swift +++ b/Sources/ComponentsKit/Components/Alert/Helpers/AlertButtonsOrientationCalculator.swift @@ -6,8 +6,8 @@ struct AlertButtonsOrientationCalculator { case horizontal } - private static let primaryButton = UKButton() - private static let secondaryButton = UKButton() + private static let primaryButton = UKButton(model: .init()) + private static let secondaryButton = UKButton(model: .init()) private init() {} diff --git a/Sources/ComponentsKit/Components/Alert/UKAlertController.swift b/Sources/ComponentsKit/Components/Alert/UKAlertController.swift index beae4539..a1731720 100644 --- a/Sources/ComponentsKit/Components/Alert/UKAlertController.swift +++ b/Sources/ComponentsKit/Components/Alert/UKAlertController.swift @@ -48,9 +48,9 @@ public class UKAlertController: UKCenterModalController { /// The label used to display the subtitle or message of the alert. public let subtitleLabel = UILabel() /// The button representing the primary action in the alert. - public let primaryButton = UKButton() + public let primaryButton = UKButton(model: .init()) /// The button representing the secondary action in the alert. - public let secondaryButton = UKButton() + public let secondaryButton = UKButton(model: .init()) /// A stack view that arranges the primary and secondary buttons. public let buttonsStackView = UIStackView() diff --git a/Sources/ComponentsKit/Components/Avatar/UIKit/UKAvatar.swift b/Sources/ComponentsKit/Components/Avatar/UIKit/UKAvatar.swift index 40a2b880..5b614f91 100644 --- a/Sources/ComponentsKit/Components/Avatar/UIKit/UKAvatar.swift +++ b/Sources/ComponentsKit/Components/Avatar/UIKit/UKAvatar.swift @@ -26,7 +26,7 @@ open class UKAvatar: UIImageView, UKComponent { /// Initializer. /// - Parameters: /// - model: A model that defines the appearance properties. - public init(model: AvatarVM = .init()) { + public init(model: AvatarVM) { self.model = model self.imageManager = AvatarImageManager(model: model) diff --git a/Sources/ComponentsKit/Components/AvatarGroup/UIKit/UKAvatarGroup.swift b/Sources/ComponentsKit/Components/AvatarGroup/UIKit/UKAvatarGroup.swift index 52fed579..dabc9411 100644 --- a/Sources/ComponentsKit/Components/AvatarGroup/UIKit/UKAvatarGroup.swift +++ b/Sources/ComponentsKit/Components/AvatarGroup/UIKit/UKAvatarGroup.swift @@ -22,7 +22,7 @@ open class UKAvatarGroup: UIView, UKComponent { /// Initializer. /// - Parameters: /// - model: A model that defines the appearance properties. - public init(model: AvatarGroupVM = .init()) { + public init(model: AvatarGroupVM) { self.model = model super.init(frame: .zero) diff --git a/Sources/ComponentsKit/Components/Badge/UKBadge.swift b/Sources/ComponentsKit/Components/Badge/UKBadge.swift index 9088b78e..d6e100db 100644 --- a/Sources/ComponentsKit/Components/Badge/UKBadge.swift +++ b/Sources/ComponentsKit/Components/Badge/UKBadge.swift @@ -29,7 +29,7 @@ open class UKBadge: UIView, UKComponent { /// Initializes a new instance of `UKBadge`. /// - Parameter model: A model that defines the appearance properties for the badge. - public init(model: BadgeVM = .init()) { + public init(model: BadgeVM) { self.model = model super.init(frame: .zero) diff --git a/Sources/ComponentsKit/Components/Button/UKButton.swift b/Sources/ComponentsKit/Components/Button/UKButton.swift index d2b35b4f..c7f573ce 100644 --- a/Sources/ComponentsKit/Components/Button/UKButton.swift +++ b/Sources/ComponentsKit/Components/Button/UKButton.swift @@ -47,7 +47,7 @@ open class UKButton: UIView, UKComponent { /// - model: A model that defines the appearance properties. /// - action: A closure that is triggered when the button is tapped. public init( - model: ButtonVM = .init(), + model: ButtonVM, action: @escaping () -> Void = {} ) { self.model = model diff --git a/Sources/ComponentsKit/Components/Card/SUCard.swift b/Sources/ComponentsKit/Components/Card/SUCard.swift index 3c0f57e6..ad6be3dd 100644 --- a/Sources/ComponentsKit/Components/Card/SUCard.swift +++ b/Sources/ComponentsKit/Components/Card/SUCard.swift @@ -27,7 +27,7 @@ public struct SUCard: View { /// - model: A model that defines the appearance properties. /// - content: The content that is displayed in the card. public init( - model: CardVM, + model: CardVM = .init(), content: @escaping () -> Content ) { self.model = model diff --git a/Sources/ComponentsKit/Components/Card/UKCard.swift b/Sources/ComponentsKit/Components/Card/UKCard.swift index 7e379647..42a54629 100644 --- a/Sources/ComponentsKit/Components/Card/UKCard.swift +++ b/Sources/ComponentsKit/Components/Card/UKCard.swift @@ -44,7 +44,10 @@ open class UKCard: UIView, UKComponent { /// - Parameters: /// - model: A model that defines the appearance properties. /// - content: The content that is displayed in the card. - public init(model: CardVM, content: @escaping Content) { + public init( + model: CardVM = .init(), + content: @escaping Content + ) { self.model = model self.content = content() diff --git a/Sources/ComponentsKit/Components/Countdown/SUCountdown.swift b/Sources/ComponentsKit/Components/Countdown/SUCountdown.swift index 48399011..2830f296 100644 --- a/Sources/ComponentsKit/Components/Countdown/SUCountdown.swift +++ b/Sources/ComponentsKit/Components/Countdown/SUCountdown.swift @@ -17,7 +17,7 @@ public struct SUCountdown: View { /// Initializer. /// - Parameters: /// - model: A model that defines the appearance properties. - public init(model: CountdownVM = .init()) { + public init(model: CountdownVM) { self.model = model } diff --git a/Sources/ComponentsKit/Components/RadioGroup/UIKit/UKRadioGroup.swift b/Sources/ComponentsKit/Components/RadioGroup/UIKit/UKRadioGroup.swift index 768e6472..3ee1a78e 100644 --- a/Sources/ComponentsKit/Components/RadioGroup/UIKit/UKRadioGroup.swift +++ b/Sources/ComponentsKit/Components/RadioGroup/UIKit/UKRadioGroup.swift @@ -41,7 +41,7 @@ open class UKRadioGroup: UIView, UKComponent, UIGestureRecognizerD /// - onSelectionChange: A closure that is triggered when the selected radio button changes. public init( initialSelectedId: ID? = nil, - model: RadioGroupVM = .init(), + model: RadioGroupVM, onSelectionChange: ((ID?) -> Void)? = nil ) { self.selectedId = initialSelectedId diff --git a/Sources/ComponentsKit/Components/SegmentedControl/UKSegmentedControl.swift b/Sources/ComponentsKit/Components/SegmentedControl/UKSegmentedControl.swift index 15fd9588..eced335a 100644 --- a/Sources/ComponentsKit/Components/SegmentedControl/UKSegmentedControl.swift +++ b/Sources/ComponentsKit/Components/SegmentedControl/UKSegmentedControl.swift @@ -53,7 +53,7 @@ open class UKSegmentedControl: UIView, UKComponent { /// - onSelectionChange: A closure that is triggered when a selected segment changes. public init( selectedId: ID, - model: SegmentedControlVM = .init(), + model: SegmentedControlVM, onSelectionChange: @escaping (ID) -> Void = { _ in } ) { self.selectedId = selectedId