Skip to content

Commit b7cd017

Browse files
committed
default loading view udpate
1 parent 85a05f6 commit b7cd017

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

Sources/ErrorableView/Views/DefaultLoadingView.swift

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ public protocol LoadingView: View {
2626
}
2727

2828
public var body: some View {
29+
#if os(macOS)
2930
ZStack {
3031
Rectangle()
31-
.foregroundColor(.red)
32-
.ignoresSafeArea()
3332
.opacity(type == .onPage ? 1 : 0.3)
3433
VStack {
3534
if #available(iOS 15.0, *) {
@@ -45,7 +44,28 @@ public protocol LoadingView: View {
4544
.foregroundColor(.secondary)
4645
.padding(.top)
4746
}
48-
}
47+
}.ignoresSafeArea()
48+
#else
49+
ZStack {
50+
Rectangle()
51+
.opacity(type == .onPage ? 1 : 0.3)
52+
VStack {
53+
if #available(iOS 15.0, *) {
54+
ProgressView()
55+
.scaleEffect(1.2)
56+
.tint(progressViewColor)
57+
} else {
58+
ProgressView()
59+
.scaleEffect(1.2)
60+
}
61+
Text(loadingText)
62+
.font(.caption)
63+
.foregroundColor(.secondary)
64+
.padding(.top)
65+
}
66+
}.ignoresSafeArea()
67+
.frame(width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)
68+
#endif
4969
}
5070
}
5171

0 commit comments

Comments
 (0)