Skip to content

Commit

Permalink
default loading view udpate
Browse files Browse the repository at this point in the history
  • Loading branch information
devmehmetates committed May 2, 2024
1 parent 85a05f6 commit b7cd017
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions Sources/ErrorableView/Views/DefaultLoadingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ public protocol LoadingView: View {
}

public var body: some View {
#if os(macOS)
ZStack {
Rectangle()
.foregroundColor(.red)
.ignoresSafeArea()
.opacity(type == .onPage ? 1 : 0.3)
VStack {
if #available(iOS 15.0, *) {
Expand All @@ -45,7 +44,28 @@ public protocol LoadingView: View {
.foregroundColor(.secondary)
.padding(.top)
}
}
}.ignoresSafeArea()
#else
ZStack {
Rectangle()
.opacity(type == .onPage ? 1 : 0.3)
VStack {
if #available(iOS 15.0, *) {
ProgressView()
.scaleEffect(1.2)
.tint(progressViewColor)
} else {
ProgressView()
.scaleEffect(1.2)
}
Text(loadingText)
.font(.caption)
.foregroundColor(.secondary)
.padding(.top)
}
}.ignoresSafeArea()
.frame(width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)
#endif
}
}

Expand Down

0 comments on commit b7cd017

Please sign in to comment.