|
|
@@ -19,7 +19,7 @@ extension Bolus {
|
|
|
HStack {
|
|
|
Text("Wait please").foregroundColor(.secondary)
|
|
|
Spacer()
|
|
|
- ProgressView()
|
|
|
+ ActivityIndicator(isAnimating: .constant(true), style: .medium) // fix iOS 15 bug
|
|
|
}
|
|
|
} else {
|
|
|
HStack {
|
|
|
@@ -102,3 +102,17 @@ extension Bolus {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// fix iOS 15 bug
|
|
|
+struct ActivityIndicator: UIViewRepresentable {
|
|
|
+ @Binding var isAnimating: Bool
|
|
|
+ let style: UIActivityIndicatorView.Style
|
|
|
+
|
|
|
+ func makeUIView(context _: UIViewRepresentableContext<ActivityIndicator>) -> UIActivityIndicatorView {
|
|
|
+ UIActivityIndicatorView(style: style)
|
|
|
+ }
|
|
|
+
|
|
|
+ func updateUIView(_ uiView: UIActivityIndicatorView, context _: UIViewRepresentableContext<ActivityIndicator>) {
|
|
|
+ isAnimating ? uiView.startAnimating() : uiView.stopAnimating()
|
|
|
+ }
|
|
|
+}
|