import SwiftUI import ProxyCore struct AppSettingsView: View { @AppStorage("analyticsEnabled") private var analyticsEnabled = false @AppStorage("crashReportingEnabled") private var crashReportingEnabled = true @State private var showClearCacheConfirmation = false private var appVersion: String { Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown" } private var buildNumber: String { Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "Unknown" } var body: some View { Form { Section { Toggle("Analytics", isOn: $analyticsEnabled) Toggle("Crash Reporting", isOn: $crashReportingEnabled) } footer: { Text("Help improve the app by sharing anonymous usage data.") } Section { Button("Clear App Cache", role: .destructive) { showClearCacheConfirmation = true } } footer: { Text("Remove all cached data. This does not delete captured traffic.") } Section("About") { LabeledContent("Version", value: appVersion) LabeledContent("Build", value: buildNumber) } } .navigationTitle("App Settings") .confirmationDialog("Clear Cache", isPresented: $showClearCacheConfirmation) { Button("Clear Cache", role: .destructive) { URLCache.shared.removeAllCachedResponses() } } message: { Text("This will clear all cached data.") } } }