TomorrowWeatherApp is a Swift-based iOS application that provides weather forecasts for multiple locations using real-time data. The app is built using the MVVM (Model-View-ViewModel) architecture and integrates with open-meteo weather API to fetch and display weather information.
- Real-Time Weather Updates: Displays weather information such as temperature, location, and hourly forecasts for predefined coordinates.
- Rotating Locations: Automatically cycles through a list of preset locations every 10 seconds to showcase weather conditions for each.
- Chart Representation: Visualizes temperature variations using SwiftUI Charts.
- Background & Foreground Handling: Saves the app's state when backgrounded and resumes seamlessly when reopened.
- Testable Architecture: Includes mocks and unit tests to ensure the accuracy of weather service and app logic.
TomorrowWeatherApp/ ├── HomeScreen/ │ ├── Views/ │ ├── InfoCard │ ├── TemperatureChartView │ ├── WeatherInfoView │ ├── WeatherView │ ├── WeatherViewModel ├── Model/ │ ├── WeatherModel ├── Network/ │ ├── Constants │ ├── URLSession ├── Service/ │ ├── WeatherService ├── Preview Content/ │ ├── Preview Assets ├── Tests/ │ ├── WeatherServiceMock │ ├── WeatherServiceTests │ ├── TomorrowWeatherAppUITests
- Clone the repository:
git clone https://github.com/Farazahmed90/TomorrowWeatherApp.git cd TomorrowWeatherApp - open TomorrowWeatherApp.xcodeproj (The latest code is in develop -> checkout on develop if needed)
- Build and run the project on a simulator or device.
Launch the app. View real-time weather updates for a rotating list of locations. Navigate through the visual temperature charts and detailed weather data.
The app includes unit tests and UI tests. Run the tests in Xcode by navigating to: Product → Test or using the shortcut Command + U.
Swift: Programming language SwiftUI: User interface framework Combine: Framework for handling asynchronous events XCTest: Testing framework
Improvements or Features to Add If this were not a test exercise, the following features or enhancements could be considered:
- **Custom Location Input: Allow users to add their own coordinates or select a location via a map interface.
- **Caching: Implement local caching for weather data to reduce API calls and enhance offline usability.
- **Localization: Add support for multiple languages and regional formats for temperature and time.
- **Error Handling: Improve user-facing error messages and provide a retry mechanism for network failures.
- **Dark Mode: Enhance UI with proper support for dark mode.
- **Settings Page: Let users configure the update interval, temperature units (Celsius/Fahrenheit), and location preferences.
- **Push Notifications: Notify users of severe weather updates or significant temperature changes.
- **Widget Support: Add home screen widgets to display quick weather updates.
- **Improved UI: Add animations, transitions, and a cleaner layout for a more polished user experience.
- **API Abstraction: Generalize the weather service to allow switching between multiple APIs