mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-11 22:55:55 +05:45
* Forks into a separate method to be preserver backwards compatibility * Resets `PurchasesDiagnosticsHealth` to state before merge * Adds missing unit tests * Fixes lint errors * Fixes errors * Updates documentation * Moves types under the debug flag * Moves more types under debug * Adds reference to error in documentations
34 lines
908 B
Swift
34 lines
908 B
Swift
//
|
|
// Copyright RevenueCat Inc. All Rights Reserved.
|
|
//
|
|
// Licensed under the MIT License (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// https://opensource.org/licenses/MIT
|
|
//
|
|
// SDKHealthStatus+Icon.swift
|
|
//
|
|
// Created by Pol Piella on 4/10/25.
|
|
|
|
#if DEBUG
|
|
import SwiftUI
|
|
|
|
@available(iOS 16.0, macOS 13.0, *)
|
|
extension PurchasesDiagnostics.SDKHealthStatus {
|
|
var icon: some View {
|
|
switch self {
|
|
case let .healthy(warnings):
|
|
return Image(systemName: warnings.count > 0
|
|
? "checkmark.circle.badge.questionmark.fill"
|
|
: "checkmark.circle.fill")
|
|
.foregroundColor(.green)
|
|
case .unhealthy:
|
|
return Image(systemName: "xmark.circle.fill")
|
|
.foregroundColor(.red)
|
|
}
|
|
|
|
}
|
|
}
|
|
#endif
|