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 @@ -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() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Sources/ComponentsKit/Components/Badge/UKBadge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion Sources/ComponentsKit/Components/Button/UKButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/ComponentsKit/Components/Card/SUCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public struct SUCard<Content: View>: 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
Expand Down
5 changes: 4 additions & 1 deletion Sources/ComponentsKit/Components/Card/UKCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ open class UKRadioGroup<ID: Hashable>: UIView, UKComponent, UIGestureRecognizerD
/// - onSelectionChange: A closure that is triggered when the selected radio button changes.
public init(
initialSelectedId: ID? = nil,
model: RadioGroupVM<ID> = .init(),
model: RadioGroupVM<ID>,
onSelectionChange: ((ID?) -> Void)? = nil
) {
self.selectedId = initialSelectedId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ open class UKSegmentedControl<ID: Hashable>: UIView, UKComponent {
/// - onSelectionChange: A closure that is triggered when a selected segment changes.
public init(
selectedId: ID,
model: SegmentedControlVM<ID> = .init(),
model: SegmentedControlVM<ID>,
onSelectionChange: @escaping (ID) -> Void = { _ in }
) {
self.selectedId = selectedId
Expand Down