ContentView that orchestrates navigation and state management.
ContentView
Root view of the application managing app-wide state and navigation.BreezeApp/App/ContentView.swift
State Management
DashboardViewModel
Main state object for air quality and environmental data
Bool
Controls search sheet presentation
Bool
Controls settings sheet presentation
AppearanceMode
Persisted appearance preference (system/light/dark) using
@AppStorageView States
ContentView renders different UI based on data availability:- Loading State - Shows
LoadingViewspinner - Dashboard State - Shows
DashboardViewwith data - Landing State - Shows welcome screen with search and location options
Landing View
Initial state when no location data is loaded:BreezeApp/App/ContentView.swift
Toolbar
Dynamic toolbar shown when data is loaded:BreezeApp/App/ContentView.swift
DashboardView
Main dashboard displaying all environmental data.BreezeApp/Views/Dashboard/DashboardView.swift
Components
VStack
Displays city name and current date
Component
Main air quality index card with status and health tips
Component
Pollen data visualization (conditionally shown)
Component
Grid of individual pollutant readings
Component
Historical temperature trend chart (conditionally shown)
Pull to Refresh
Therefreshable modifier enables pull-to-refresh gesture:
Dashboard Components
AQICard
Displays AQI value with color-coded status and health information.BreezeApp/Views/Dashboard/AQICard.swift
PollutantsGrid
Grid layout showing individual pollutant concentrations.BreezeApp/Views/Dashboard/PollutantsGrid.swift
PollenView
Horizontal scrolling list of pollen items.BreezeApp/Views/Environmental/PollenView.swift
ClimateChartView
Line chart showing historical temperature trends.BreezeApp/Views/Environmental/ClimateChartView.swift
Search View
City search interface with real-time results.BreezeApp/Views/Search/SearchView.swift
Utility Components
LoadingView
Simple loading indicator.BreezeApp/Views/Components/LoadingView.swift
AnimatedText
Text with fade-in animation.BreezeApp/Views/Components/AnimatedText.swift
HealthTipsView
Scrollable list of health tips.BreezeApp/Views/Components/HealthTipsView.swift
Settings View
App settings and preferences.BreezeApp/Views/Components/SettingsView.swift
Theme Colors
Custom colors defined inColor+Theme.swift:
.appBackground- Main app background.cardBackground- Card and component backgrounds.searchBarBackground- Search bar background.aqiGood- Good AQI level (green).aqiModerate- Moderate AQI level (yellow).aqiUnhealthySensitive- Unhealthy for sensitive groups (orange).aqiUnhealthy- Unhealthy level (red).aqiVeryUnhealthy- Very unhealthy (purple).aqiHazardous- Hazardous level (maroon)
View Modifiers
Common view modifiers used throughout:.preferredColorScheme()- Apply appearance mode.refreshable- Pull to refresh.sheet()- Present modal sheets.toolbar()- Configure navigation bar.padding()- Add spacing.background()- Apply background colors.cornerRadius()- Round corners.font()- Typography