https://github.com/wdesimini/weather
Weather app using MVVM, Concurrency, SwiftUI
https://github.com/wdesimini/weather
async-await concurrency dependency-injection mvvm swift swift-packages swiftui unit-testing xctest
Last synced: 3 months ago
JSON representation
Weather app using MVVM, Concurrency, SwiftUI
- Host: GitHub
- URL: https://github.com/wdesimini/weather
- Owner: wdesimini
- Created: 2024-12-13T18:57:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-14T00:07:39.000Z (over 1 year ago)
- Last Synced: 2025-04-01T10:45:49.015Z (over 1 year ago)
- Topics: async-await, concurrency, dependency-injection, mvvm, swift, swift-packages, swiftui, unit-testing, xctest
- Language: Swift
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Weather
This app uses [Weather API](https://www.weatherapi.com/) to fetch weather data and features MVVM architecture, SwiftUI, local-package-based modular design and comprehensive unit tests.
## Quick Start
Follow these steps to get started:
1. **Clone the Repository**
```bash
git clone https://github.com/wdesimini/Weather.git
cd weather
```
2. **Open the Project in Xcode**
Open the `.xcodeproj` file in Xcode.
3. **Add Your API Key**
- Navigate to `APIService.swift` located in the `Networking` package.
- Replace `WEATHER_API_KEY` with your actual API key:
```swift
public enum APIEnvironment {
public static let key = "WEATHER_API_KEY"
}
```
4. **Run the App**
- Select a simulator or a connected device.
- Build and run the app using the play button in Xcode or by pressing `Cmd + R`.
## Features
### MVVM Architecture
Uses a combination of dependency-injected `@Observable` ViewModels and async/await-based Services.
### Modular Local Packages
The project is divided into reusable Swift packages, making it easier to maintain, scale, and test.
### Unit Testing
Includes unit tests for ViewModels and Services using the XCTest framework. Mock services are provided to test ViewModels in isolation.