mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-11 22:55:55 +05:45
33 lines
635 B
Swift
33 lines
635 B
Swift
//
|
|
// ProgressView.swift
|
|
//
|
|
//
|
|
// Created by Nacho Soto on 12/20/23.
|
|
//
|
|
|
|
import Foundation
|
|
import SwiftUI
|
|
|
|
/// `SwiftUI.ProgressView` overload that becomes non-animated during snapshots.
|
|
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
|
|
struct ProgressView: View {
|
|
|
|
#if DEBUG
|
|
@Environment(\.isRunningSnapshots)
|
|
private var isRunningSnapshots
|
|
#endif
|
|
|
|
var body: some View {
|
|
#if DEBUG
|
|
if self.isRunningSnapshots {
|
|
SwiftUI.ProgressView(value: 0.5)
|
|
} else {
|
|
SwiftUI.ProgressView()
|
|
}
|
|
#else
|
|
SwiftUI.ProgressView()
|
|
#endif
|
|
}
|
|
|
|
}
|