A simple and modern weather application built with SwiftUI, consuming the OpenWeatherMap API to display the current weather of any city.
Designed as part of my portfolio to showcase best practices in iOS development: MVVM architecture, API consumption, state management, and reactive UI using SwiftUI.
- Search for weather by city
- Display current temperature, weather description, and representative icon
- Clean and responsive UI
- MVVM architecture
- API consumption using
async/await - Error handling and loading states
- Swift 5
- SwiftUI
- MVVM
- OpenWeatherMap API
- Combine / async-await
WeatherApp/
βββ Models/
β βββ WeatherResponse.swift
βββ ViewModels/
β βββ WeatherViewModel.swift
βββ Views/
β βββ WeatherView.swift
βββ Services/
β βββ WeatherService.swift
βββ Utils/
β βββ Constants.swift
βββ WeatherApp.swift
- Xcode 15 or later.
- An account on OpenWeatherMap to obtain a free API key.
- Add your API key in the
Constants.swiftfile:
enum Constants {
static let apiKey = "YOUR_API_KEY_HERE"
}- Clone the repository:
git clone https://github.com/Daztery/weather_app.git- Open the project in Xcode:
open WeatherApp.xcodeproj- Replace the API key in
Constants.swift - Run the app on the simulator or your device
- Save recent or favorite cities
- Show hourly or 7-day forecast
- Offline support with local storage
- Location-based weather (using CoreLocation)