1.6.0 #9: auto-backup programado a iCloud Drive/Archivos

El BackupService (export JSON v3 lossless a local + iCloud ubiquity, retención,
restore, premium-gated) ya existía de 1.1.0 pero solo era manual. Añadido lo automático:
- BackupService.runScheduledBackupIfNeeded() (config vía UserDefaults, gate por
  backupsEnabled+premium, respeta frecuencia).
- Disparo en foreground (scenePhase .active) en background queue.
- Frecuencia Off/Diario/Semanal/Mensual + fecha del último backup en Settings
  (SettingsViewModel.autoBackupFrequencyDays + updateAutoBackupFrequency).
- Strings en 7 idiomas.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L2p3gUZRNWW388rWFRjiU7
This commit is contained in:
alexandrev-tibco
2026-07-25 17:31:53 +02:00
parent 6887d05b01
commit 648c2bd805
11 changed files with 121 additions and 0 deletions
@@ -534,6 +534,27 @@ struct SettingsView: View {
}
}
if viewModel.backupsEnabled {
Picker("Auto Backup", selection: Binding(
get: { viewModel.autoBackupFrequencyDays },
set: { viewModel.updateAutoBackupFrequency($0) }
)) {
Text("Off").tag(0)
Text("Daily").tag(1)
Text("Weekly").tag(7)
Text("Monthly").tag(30)
}
if let last = viewModel.lastAutoBackupDate {
HStack {
Text("Last auto backup")
Spacer()
Text(last, style: .date)
.foregroundColor(.secondary)
}
.font(.caption)
}
}
NavigationLink {
CategoriesView()
} label: {