PrivacyInsights follows a clean, modular architecture with clear separation of concerns:
MVVM with Services Layer
@State, @StateObject, @ObservedObject@AppStorage for user preferencesNavigationStack instead of NavigationViewLazyVStack for scrollable lists.foregroundStyle() instead of .foregroundColor().clipShape() instead of .cornerRadius().task modifier for async loadingsheet(item:) for robust state handling@MainActor for all UI-related classesasync/await for asynchronous operationsTask { } for async operations in viewsnonisolated for delegate methods@StateObject for view-owned services@ObservedObject for injected services@State for view-local state@AppStorage for persistent preferencesNWConnectionTaskGroupLazyVStack for large listsbodyMainActor.runCentralised management for tasks that require extended execution time.