A simple weather forecast application with data provided from OpenWeatherMap.

Overview

Weather Forecast Example Application

Makefile CI

Author: Long Kim

This repo contains the source code for a simple weather forecast application with data provided from OpenWeatherMap.

Requirements

  • iOS 11.0+ (to provides proper support for safe areas)
  • Xcode 13.0
  • Java Development Kit (must be JDK 11).

How to run locally

# Set JAVA_HOME to JDK 11 if you haven't already
export JAVA_HOME=/some/path/that/contains/jdk/Home

make install_buck # will download a buck executable at tools/buck
make project

Then Xcode will open the generated workspace for you.

Architectural Design

The project applies the MVVM design pattern, coupled with dependency injection to achieve a clean and modular codebase.

This brings many advantages:

  • Separates the view layer from the business logic. In traditional MVC pattern, particularly in iOS development, the view controller knows too much about the data access, business logic etc. With MVVM, it only needs to know about the view model, and responds to data changes by observing this view model object.
  • Promotes a modular architecture. This enhances the development experience, allowing work to be done to different modules at the same time, as well as making writing unit tests much easier.
  • DI abstracts the implementation from the interface. This allows mocking in testing for faster/more reliable unit tests, while the level of abstraction means that your implementation of a class can evolve without breaking existing code, leading to longer and more error-prone development process.

Project Structure

The project is built using Buck, a build system developed and used by Facebook. It encourages the creation of small, reusable modules consisting of code and resources, and supports a variety of languages on many platforms.

The project is structured into multiple modules, which provides logical separation as well as speed up builds, as independent modules can be built in parallel. The following graph represents the current modules in the application:

Dependency Graph

The main modules are:

  • WeatherForecastCore: contains the business logic.
  • WeatherForecastNetworking: provides request/response handling.
  • WeatherForecastUI: provides view layer-related facilities (data sources, view models, etc.)
  • Resources: contains app resources (storyboards, strings, XIBs etc.)

Third-party Frameworks and Libraries

  • Alamofire: Provides HTTP networking for the application.
  • AlamofireImage: Provides image deserialization, bitmap decoding in the background and a simple caching mechanism, which greatly improves image loading and rendering performance for the application.
  • Swinject: Provides dependency injection for the application.
  • DiffableDataSources: A backport of Apple's UITableViewDiffableDataSource (iOS 13.0+) for iOS 9.0+, which provides a data source that can compute inserts/deletes/moves efficiently and less error-prone than traditional performBatchUpdates.

Continuous Integration (CI)

This project is configured with GitHub Actions, which will run tests automatically on every push.

Below is the output of an example run, which is triggered on a push:

GitHub Action

Checklist

  • Programming language: Swift is required, Objective-C is optional.

  • Design app's architecture (MVC or MVP, MVVM).

  • UI should be looks like in attachment.

  • Write UnitTests (nice to have).

    • Networking Code
    • Weather Forecast Fetching Logic
    • UI Test

    Current coverage: Coverage

  • Exception handling (optional). The app can handle cases where city is not found, and a generic error case.

  • README file is included.

You might also like...
WeatherApp - WeatherApp Using Openweathermap api
WeatherApp - WeatherApp Using Openweathermap api

WeatherApp Requirements XCode 13 IOS 15 Highlights Use [OpenWeatherMap] API Use

NearbyWeather - OpenWeatherMap Client
NearbyWeather - OpenWeatherMap Client

NearbyWeather is a simple weather app, that provides current weather information for nearby cities, as well for bookmarked locations. NearbyWeather uses the OpenWeatherMap API to download weather data. Additionally the OpenWeatherMaps location database is directly bootstrapped into the app for quick access.

A Simple Weather App Using the Open Weather Map api

The Weather, a Simple Weather App Using the Open Weather Map api. This app demos use of the Open Weather Map api. The UI is simple, with views of the

Simple Weather app to display future weather of 3 cities

WeatherApp Simple Weather app to display future weather of 3 cities Test project for a small weather application Overview For the test project a small

Weather-app - Created a simple weather app on Xcode using SwiftUI, only shows one location

weather-app Created a simple weather app on Xcode using SwiftUI, only shows one

Ios-weather-app - A simple weather app with swift
Ios-weather-app - A simple weather app with swift

AHOY Assignment Weather app Main Screen Settings Architecture The Architecture u

A SwiftUI Weather App powered by World Weather Online API
A SwiftUI Weather App powered by World Weather Online API

SwiftUI-Weather The SwiftUI Weather app, allow users get the current weather for a particular locatio and view a 5-day weather forecast for the select

Swift Language Weather is an iOS weather app developed in Swift
Swift Language Weather is an iOS weather app developed in Swift

Swift Language Weather SwiftWeather has renamed to Swift Language Weather. Because this repo is ranked number one in Google when we search "Swift Weat

Simple weather application in Swift for iOS 15.
Simple weather application in Swift for iOS 15.

DaWeather ⛅️ Simple weather application in Swift for iOS 15. General Information DaWeather ⛅️ will help you determine the current weather Features Get

Owner
Long Kim H.
Associate Software Developer, Zalo Computer Science Student Ho Chi Minh University of Technology
Long Kim H.
A simple clean application to provide you with weather forecast data as well as currency rates, all with beautiful melodies and sounds

A simple clean application to provide you with weather forecast data as well as currency rates, all with beautiful melodies and sounds.

Sergey 1 Jan 21, 2022
CZWeatherKit is a simple, extensible weather library for iOS, tvOS, and OS X that allows for easy fetching of weather data from various weather services.

CZWeatherKit is a simple, extensible weather library for iOS, tvOS, and OS X that allows for easy fetching of weather data from various weather services.

Comyar 455 Nov 20, 2022
Weather App with widget that fetches real weather data using the Open Weather API

WeatherExtension App Demo WeatherExtension.mp4 Description Weather App that fetches real weather data using the Open Weather API Getting Started clone

Kayla Golder 0 Oct 21, 2021
Weather - Use Open weather APIs to fetch live weather data

Weather ??️ Use Open weather APIs to fetch live weather data Use Core Location p

Vicky Lee 2 Jun 3, 2022
Weather Forecast App (OpenWeather API & CLLocationManager). Clean Swift VIP architecture.

WeatherApp Weather Forecast App (OpenWeather API & CLLocationManager). Clean Swift VIP architecture. Without storyboard or xib. The application shows

Nikita Lomovtsev 7 Dec 25, 2022
IOSWeather - An app that allows people to get weather forecast

iOSWeather iOSWeather is an app that allows people to get weather forecast. App

null 0 Jan 13, 2022
Weatherapp - An iOS app that shows the weather forecast in Toronto

☀️ Weather App An iOS app that shows the weather forecast in Toronto ?? About Th

Ana Letícia Camargos 0 Jan 29, 2022
WeatherApp - A simple weather app utilizing Google Places API for search and OpenWeather for weather data

Swift Weather App About A simple weather app utilizing Google Places API for sea

null 0 Jan 5, 2022
LiveWeatherApp - Live Weather App - Displays Live Weather Data with OpenWeather API

Live Weather App - Displays Live Weather Data with OpenWeather API Learned about

Matt Wong 1 Feb 5, 2022
Forecast App is an ios application built on top of omdb movie api for batman lovers to see their favorite batman movies

Catbon-Movie-App Forecast App is an ios application built on top of omdb movie api for batman lovers to see their favorite batman movies, users can al

GuruKing 0 Dec 6, 2021