Skip to content

An iOS UIKit app that displays real-time weather data using the OpenWeather API, featuring city search, forecast, and local data persistence.

Notifications You must be signed in to change notification settings

asperez26/WeatherApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🌦️ Weather App

An iOS UIKit application that displays real-time weather information for multiple cities using the OpenWeather API.
This project demonstrates API integration, JSON parsing, local data persistence, and custom UI layouts — built as part of an academic project at Seneca Polytechnic.


🚀 Features

  • 🔍 City Search — Look up any city using OpenWeather’s Geocoding API
  • 🌆 City Watchlist — Save and manage your list of tracked cities
  • 🌤️ Current Weather Display — View real-time temperature, condition, and weather icon
  • 📅 5-Day Forecast — Displays detailed upcoming weather with time-based updates
  • 💾 Local Persistence — Saves your cities locally using PropertyListEncoder and PropertyListDecoder
  • Onboarding Screen — Animated gradient welcome view for a polished first-launch experience

🧩 Architecture Overview

The app follows the MVC pattern (Model–View–Controller), separating data, UI, and logic for maintainability.

Models

  • WeatherModel.swift — Handles current weather data, temperature, icons, and sunrise/sunset logic
  • ForecastModel.swift — Decodes and structures 5-day forecast data
  • CityModel.swift — Represents city name and coordinates
  • PersistenceManager.swift — Saves and retrieves stored cities using property lists

Controllers

  • CityListCollectionViewController — Displays saved cities with live weather updates
  • SearchCityViewController — Allows users to search and add new cities via API
  • ForecastDetailViewController — Shows detailed forecast for selected city
  • OnboardingViewController — Welcome screen with gradient animation

Services

  • WeatherService.swift — Handles all API requests and JSON decoding from OpenWeather

Views

  • CityCollectionViewCell — Custom collection cell with gradient temperature background
  • ForecastTableViewCell — Table cell showing daily forecasts

🌤️ API Integration

This app uses the OpenWeather API for weather data and geocoding:

  • Weather Endpoint:
    https://api.openweathermap.org/data/2.5/weather

  • Forecast Endpoint:
    https://api.openweathermap.org/data/2.5/forecast

  • Geocoding Endpoint:
    https://api.openweathermap.org/geo/1.0/direct

All data is fetched asynchronously and decoded into Swift models using Codable.


🧠 Key Technical Highlights

  • Swift 5 & UIKit
  • Networking: URLSession with async data tasks
  • Persistence: Property List Encoding/Decoding
  • UI Design: CollectionView + TableView controllers
  • Animation: CAGradientLayer for dynamic weather visuals
  • Error Handling: Safe optional unwrapping for network results

📸 App Preview

🪄 Splash Screen

Splash Screen
Splash Screen

🌆 Watchlist

Empty Watchlist Add City Added Cities Delete Cities
Empty Watchlist Search City Watchlist Cities Delete City

🔍 Search & Add Cities

Search Toronto Search Manila
Search Toronto Search Manila

☁️ Weather Details

Current Weather 5-Day Forecast
Weather Details Toronto Weather Forecast

👩‍💻 Author

Andrea Selina Perez
📍 Seneca Polytechnic – Computer Programming (iOS & Data Structures focus)
📫 andreaselinaperez26@gmail.com
🌐 GitHub Profile


If you liked this project, consider giving it a star on GitHub!

About

An iOS UIKit app that displays real-time weather data using the OpenWeather API, featuring city search, forecast, and local data persistence.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages