40 lines
1.3 KiB
Swift
40 lines
1.3 KiB
Swift
import SwiftUI
|
|
|
|
struct AppSettingsView: View {
|
|
@State private var analyticsEnabled = false
|
|
@State private var crashReportingEnabled = true
|
|
@State private var showClearCacheConfirmation = false
|
|
|
|
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: "1.0.0")
|
|
LabeledContent("Build", value: "1")
|
|
}
|
|
}
|
|
.navigationTitle("App Settings")
|
|
.confirmationDialog("Clear Cache", isPresented: $showClearCacheConfirmation) {
|
|
Button("Clear Cache", role: .destructive) {
|
|
// TODO: Clear URL cache, image cache, etc.
|
|
}
|
|
} message: {
|
|
Text("This will clear all cached data.")
|
|
}
|
|
}
|
|
}
|