Overview
The Pollen Tracking feature provides allergy sufferers with detailed information about current pollen levels from various plants and pollen types. Powered by Google’s Pollen API, it displays data in an easy-to-understand grid format with detailed plant information.Implementation
PollenView Component
The pollen tracker uses a two-column grid layout to display pollen items:PollenView.swift
Pollen Item Card
Each pollen type is displayed in a compact card with:- Pollen name
- Current level (0-5 scale)
- Visual progress bar
- Status text (None, Low, Moderate, High, Very High)
- Color-coded indicators
PollenView.swift
Pollen Levels
Pollen is measured on a 0-5 scale with corresponding color coding:None (0)
Color: Green (#34c759)No pollen detected in the air
Low (1)
Color: Green (#34c759)Minimal pollen levels, unlikely to cause symptoms
Moderate (2-3)
Color: Orange (#ff9500)Noticeable pollen levels, sensitive individuals may experience symptoms
High (4)
Color: Red (#ff3b30)High pollen concentration, most allergy sufferers will be affected
Very High (5)
Color: Maroon (#8e0000)Extreme pollen levels, severe symptoms likely for those with allergies
Level Calculation
Pollen levels are determined inPollenData.swift:
PollenData.swift
Pollen Types Tracked
The app tracks both general pollen categories and specific plant pollens:General Categories
- Grass - All grass pollens
- Tree - Tree pollens (various species)
- Weed - Weed pollens
Specific Plants
Examples include:- Ragweed
- Oak
- Birch
- Pine
- Cedar
- And many more…
Detail Sheet
Tapping a pollen item opens a detailed view with comprehensive information:PollenView.swift
Data Structure
Pollen data is structured with comprehensive plant information:PollenData.swift
Google Pollen API Integration
Data is fetched from Google’s Pollen API throughPollenService.swift:
- Provides daily pollen forecasts
- Includes both general pollen types and specific plant species
- Returns health recommendations
- Provides plant images and descriptions
- Available for locations worldwide
Color Coding
Pollen level colors are defined inColor+Theme.swift:
Color+Theme.swift
Conditional Display
The pollen section only appears when data is available:DashboardView.swift
File Locations
- Component:
BreezeApp/Views/Environmental/PollenView.swift - Model:
BreezeApp/Models/PollenData.swift - Service:
BreezeApp/Services/PollenService.swift - Colors:
BreezeApp/Extensions/Color+Theme.swift