Skip to content

Commit

Permalink
builder methods set public
Browse files Browse the repository at this point in the history
  • Loading branch information
devmehmetates committed Nov 5, 2023
1 parent 4bbab89 commit c59292f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Sources/ErrorableView/ErrorableViewProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,50 +157,52 @@ public extension ErrorableView where Content: View {
private var buttonTitle: LocalizedStringKey?
private var buttonAction: (() -> Void)?
private var dismissAction: (() -> Void)?

public init() {}

@discardableResult
func title(_ title: LocalizedStringKey) -> Self {
public func title(_ title: LocalizedStringKey) -> Self {
self.title = title
return self
}

@discardableResult
func subtitle(_ subtitle: LocalizedStringKey?) -> Self {
public func subtitle(_ subtitle: LocalizedStringKey?) -> Self {
self.subtitle = subtitle
return self
}

@discardableResult
func icon(_ icon: String?) -> Self {
public func icon(_ icon: String?) -> Self {
self.icon = icon
return self
}

@discardableResult
func systemName(_ systemName: String?) -> Self {
public func systemName(_ systemName: String?) -> Self {
self.systemName = systemName
return self
}

@discardableResult
func buttonTitle(_ buttonTitle: LocalizedStringKey?) -> Self {
public func buttonTitle(_ buttonTitle: LocalizedStringKey?) -> Self {
self.buttonTitle = buttonTitle
return self
}

@discardableResult
func dismissAction(_ dismissAction: (() -> Void)?) -> Self {
public func dismissAction(_ dismissAction: (() -> Void)?) -> Self {
self.dismissAction = dismissAction
return self
}

@discardableResult
func buttonAction(_ buttonAction: (() -> Void)?) -> Self {
public func buttonAction(_ buttonAction: (() -> Void)?) -> Self {
self.buttonAction = buttonAction
return self
}

func build() -> ErrorStateConfigureModel {
public func build() -> ErrorStateConfigureModel {
ErrorStateConfigureModel(
title: title,
subtitle: subtitle,
Expand Down

0 comments on commit c59292f

Please sign in to comment.