diff --git a/Shared/views/SettingsView.swift b/Shared/views/SettingsView.swift index 4a648f8..4753ff5 100644 --- a/Shared/views/SettingsView.swift +++ b/Shared/views/SettingsView.swift @@ -6,6 +6,7 @@ // import SwiftUI +import CloudKitSyncMonitor struct SettingsView: View { @Environment(\.dismiss) var dismiss @@ -17,6 +18,7 @@ struct SettingsView: View { @State private var showSpecialThanks = false @State private var showWhyBGMode = false + @ObservedObject var syncMonitor = SyncMonitor.shared var body: some View { ZStack { @@ -31,6 +33,7 @@ struct SettingsView: View { showOnboardingButton whyBackgroundMode specialThanksCell + cloudKitStatus Spacer() } .padding() @@ -188,6 +191,20 @@ struct SettingsView: View { .fixedSize(horizontal: false, vertical: true) .clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous)) } + + private var cloudKitStatus: some View { + ZStack { + Color(UIColor.systemBackground) + VStack { + Image(systemName: syncMonitor.syncStateSummary.symbolName) + .foregroundColor(syncMonitor.syncStateSummary.symbolColor) + Text( syncMonitor.syncStateSummary.isBroken ? "cloudkit is broken" : "cloudkit is good") + } + .padding() + } + .fixedSize(horizontal: false, vertical: true) + .clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous)) + } } struct SettingsView_Previews: PreviewProvider {