A comprehensive iOS app for UV index monitoring and sun safety, built with SwiftUI. Sunshade helps users stay safe in the sun by providing real-time UV data, personalized recommendations, and exposure tracking.
- Live UV index data from Apple WeatherKit (iOS 16+)
- Location-based weather information
- Current temperature and cloud cover
- Color-coded UV level indicators (Low, Moderate, High, Very High, Extreme)
- Customizable exposure timers (10-30 minutes)
- Visual countdown with circular progress indicator
- Automatic session logging when timer completes
- Detailed tracking of sun exposure sessions
- Records duration, location, time of day, UV index, and temperature
- Timeline view showing most recent sessions first
- Persistent storage across app launches
- Expandable 5-day weather forecast
- Tanning Quality Indicators - Smart recommendations based on UV index and cloud cover:
- π― Great: Perfect tanning conditions (UV 8+, low clouds)
- π Good: Good tanning weather (UV 5-7, some clouds)
- π Fair: Moderate conditions (UV 2-4, mixed clouds)
- π Poor: Not ideal for tanning (UV 0-1, heavy clouds)
- Safe exposure time calculations based on current UV index
- Dynamic safety tips and warnings
- SPF recommendations and reapplication reminders
- Shade-seeking advice during peak hours
- Editable user name with personalized greetings
- Skin type selection for customized recommendations
- Weekly exposure statistics and session tracking
- Time-sensitive greetings (Good Morning/Afternoon/Evening)
- Clean, intuitive interface with card-based layout
- Real-time location display with refresh capability
- UV index card with safe exposure time recommendations
- Daily progress tracking
- Pull-to-refresh functionality
Main dashboard showing UV index, weather conditions, and safety recommendations
Customizable safety timer with exposure session logging
5-day forecast with tanning quality indicators
User profile with statistics and personalization options
- MVVM Pattern: Clean separation of concerns with ObservableObject view models
- SwiftUI: Modern declarative UI framework
- Combine Framework: Reactive programming for data flow
- Core Location: GPS-based location services
- Apple WeatherKit: Weather and UV data source (iOS 16+)
- Location Services: Automatic location detection and reverse geocoding
- UserDefaults: Persistent storage for user preferences and exposure logs
WeatherData: Comprehensive weather information with forecast dataExposureSession: Detailed session tracking with environmental contextUserProfile: Personalized user settings and preferencesTanningQuality: Smart quality assessment system
- iOS 16.0+ (required for WeatherKit)
- Xcode 14.0+
- Apple Developer Account (for WeatherKit)
- Clone the repository
- Open
Sunshade.xcodeprojin Xcode - WeatherKit will work automatically with your Apple Developer account
- Enable location permissions in your iOS simulator/device
- Build and run the project
WeatherKit (iOS 16+):
- No configuration needed - uses your Apple Developer account
- 500,000 free API calls per month
- No API keys required
Sunshade/
βββ Models/
β βββ DashboardViewModel.swift # Main app state management
β βββ WeatherData.swift # Weather and forecast models
β βββ ExposureLog.swift # Session tracking models
β βββ UserProfile.swift # User preferences
β βββ UVLevel.swift # UV classification
βββ Views/
β βββ DashboardView.swift # Main dashboard
β βββ SafetyTimerView.swift # Timer and activity log
β βββ WeatherCard.swift # Expandable weather forecast
β βββ UVIndexCard.swift # UV monitoring display
β βββ ProfileView.swift # User profile management
β βββ EducationView.swift # Sun safety education
βββ Services/
β βββ WeatherKitService.swift # Apple WeatherKit integration
β βββ LocationManager.swift # GPS and location services
βββ Utils/
βββ AppColors.swift # UI color scheme
βββ TimeUtils.swift # Time formatting utilities
βββ Configuration.swift # App configuration
- SwiftUI - Modern declarative UI
- Combine - Reactive programming
- Core Location - GPS and geocoding
- URLSession - Network requests
- UserDefaults - Data persistence
- Timer - Background timing functionality
This project is licensed under the MIT License - see the LICENSE file for details.
- Weather data provided by Apple WeatherKit
- UV safety guidelines from WHO UV Index
- Built with β€οΈ using SwiftUI
Stay safe in the sun! βοΈπ§΄



