Weather Forecast is a simple weather app, built with Apple's new SwiftUI and Combine framework, retrieved data from Open Weather Map, a third-party APIs that allows developers to access their data and functionality by making requests with specific parameters to a URL. Conceptual project to present MVVM with new SwiftUI, Combine + Clean approach.
This project was written in Swift 5 and requires XCode 12 to build and run. Only need to open the project by XCode and wait for the Swift Package Dependency to fetch libraries.
- SwiftUI
- Combine
This project was written using MVVM architecture + Clean architecture approach Apply factory pattern to generate SwiftUI View along with its viewModel.
-
Application -
WeatherApp
, application starting point. -AppEnvironment
- define DIContainer for Dependency Injection, leveraging theEnvironment
of SwiftUI. -AppConstants
, configure app constants -
Core
-
Usecases
- protocols, contains the application/business logic for a specific usecase in the app. -
Gateways
- protocols, belongings to Application logic, will be implemented in Gateways and Framework Logic -
Entities
- Swift classes/structs → models objects used by the app.
-
-
EntityGateway, contains the concrete implementation for the protocol defined in Core (application/business logic), ex: API Operator, Local Persistence, specifc iOS APIs (Camera, ...)
-
Scenes → Presentation logic (MVVM)
-
Composition
, Dependency Injection -
ViewModel
, contains presentation logic -
View
, the view layer, implemented using SwiftUI
-
-
Constants, self-explanatory
-
Utils, including Helpers, Extension...
-
The application is a simple iOS application which is written by Swift.
-
The application is able to retrieve the weather information from OpenWeatherMaps API.
-
The application is able to allow user to input the searching term.
-
The application is able to proceed searching with a condition of the search term length must be
from 3 characters or above.
-
The application is able to render the searched results as a list of weather items.
-
The application is able to load the weather icons remotely and displayed on every weather item at
the right-hand side.
- The application is able to handle failures.