Migrate from iOS 17 Observation to iOS 16-compatible Combine architecture.

Lower deployment target to iOS 16, replace @Observable with ObservableObject, add navigation and UI compatibility shims, and include login smoke UI tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-26 10:16:35 +08:00
parent c32a610ee0
commit 26f4d0e671
127 changed files with 2320 additions and 1465 deletions

View File

@ -6,22 +6,21 @@
//
import Foundation
import Observation
import Combine
/// ViewModel线
@MainActor
@Observable
final class LocationReportViewModel {
var isOnline = false
var reminderMinutes = 30
var secondsUntilReport = 0
var currentCoordinate: LocationCoordinate?
var markedCoordinate: LocationCoordinate?
var currentAddress = ""
var markedAddress = ""
var lastReportText = ""
var errorMessage: String?
var isSubmitting = false
final class LocationReportViewModel: ObservableObject {
@Published var isOnline = false
@Published var reminderMinutes = 30
@Published var secondsUntilReport = 0
@Published var currentCoordinate: LocationCoordinate?
@Published var markedCoordinate: LocationCoordinate?
@Published var currentAddress = ""
@Published var markedAddress = ""
@Published var lastReportText = ""
@Published var errorMessage: String?
@Published var isSubmitting = false
///
var countdownText: String {
@ -130,18 +129,17 @@ final class LocationReportViewModel {
/// ViewModel
@MainActor
@Observable
final class LocationReportHistoryViewModel {
var selectedType: LocationReportType = .all
var startDate: Date?
var endDate: Date?
var items: [LocationReportHistoryItem] = []
var errorMessage: String?
var isLoading = false
var isLoadingMore = false
var total = 0
final class LocationReportHistoryViewModel: ObservableObject {
@Published var selectedType: LocationReportType = .all
@Published var startDate: Date?
@Published var endDate: Date?
@Published var items: [LocationReportHistoryItem] = []
@Published var errorMessage: String?
@Published var isLoading = false
@Published var isLoadingMore = false
@Published var total = 0
private var page = 1
@Published private var page = 1
private let pageSize = 20
///