Skip to content

Commit

Permalink
add view will appear method
Browse files Browse the repository at this point in the history
  • Loading branch information
devmehmetates committed Feb 17, 2024
1 parent cd6debb commit 7c9d042
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/ErrorableView/Abstract/ErrorableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public protocol ErrorableViewP: View where Presenter: ErrorableBasePresenter {
@ViewBuilder var errorContent: Self.ErrorContent { get }
var errorStateConfigModel: ErrorStateConfigureModel { get }
var errorPresentType: ErrorPresentTypes { get }

func viewWillAppear()
}

public protocol ErrorableView: View where ViewModel: ErrorableBaseViewModel {
Expand Down Expand Up @@ -122,6 +124,9 @@ public extension ErrorableViewP {
sheetConfiguration()
}
}.animation(.spring, value: presenter.pageState)
.onAppear {
viewWillAppear()
}
}

@ViewBuilder var loadingContent: some View {
Expand All @@ -139,6 +144,8 @@ public extension ErrorableViewP {
}

var errorPresentType: ErrorPresentTypes { .onPage }

func viewWillAppear() {}
}

fileprivate extension ErrorableViewP {
Expand Down

0 comments on commit 7c9d042

Please sign in to comment.