Skip to content

Commit

Permalink
Merge pull request #1 from hoangthuytruc/v2
Browse files Browse the repository at this point in the history
Redesign Weather Forecast app
  • Loading branch information
hoangthuytruc authored Aug 8, 2024
2 parents da6cc33 + df6b05a commit 06706e2
Show file tree
Hide file tree
Showing 111 changed files with 289,518 additions and 1,446 deletions.
4 changes: 3 additions & 1 deletion Podfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
platform :ios, '12.0'

target 'WeatherForecast' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

# Pods for WeatherForecast
pod 'SwiftLint'
pod 'RealmSwift', '~>10'

target 'WeatherForecastTests' do
inherit! :search_paths
# Pods for testing
pod 'RealmSwift', '~>10'
end

target 'WeatherForecastUITests' do
Expand Down
14 changes: 12 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
PODS:
- Realm (10.52.2):
- Realm/Headers (= 10.52.2)
- Realm/Headers (10.52.2)
- RealmSwift (10.52.2):
- Realm (= 10.52.2)
- SwiftLint (0.42.0)

DEPENDENCIES:
- RealmSwift (~> 10)
- SwiftLint

SPEC REPOS:
trunk:
- Realm
- RealmSwift
- SwiftLint

SPEC CHECKSUMS:
Realm: e44eb7d20fe469fe1179894fd356727b8fbe61c2
RealmSwift: 7aacbd3101158f7d54c930bcfcfaafadbd376ffc
SwiftLint: 4fa9579c63416865179bc416f0a92d55f009600d

PODFILE CHECKSUM: 26e6f90ffc6e269bbf96bf96e23bd31133c13dfd
PODFILE CHECKSUM: 7ffdba4047350793229a6e7bcfab2434e3c1c8bd

COCOAPODS: 1.10.1
COCOAPODS: 1.15.2
75 changes: 36 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,50 @@
# WeatherForecast
WeatherForecast is an application to retrieve weather information within 5-7 days.
# Weather App
WeatherForecast is an application to retrieve the weather information for a specific city. The main features include:
- Retrieve the weather information for a specific city.
- Add the favorite cities.

## Screenshot
![screenshot](/screenshots/screenshot.png)
## Screenshots
<img src="/screenshots/screenshots-1.png" width=30% height=30%> <img src="/screenshots/screenshots-2.png" width=30% height=30%> <img src="/screenshots/screenshots-3.png" width=30% height=30%>

## Overview
### The structure of project
```
| WeatherForecast/
|--- Configuration/
|--- ApiSerice/
|--- LocalDatabaseService/
|--- Decorator/
| |--- TextSizeEditor/
|--- Model/
| |--- QueryWeather/
| | |--- Weather/
| | | |--- City/
| | | |--- WeatherItem/
| | |--- QueryWeatherRequest
| | |--- QueryWeatherResponse
|--- Controllers/
| |--- Weather
| | |--- ViewModel
| | |--- View
|--- Utils/
| WeatherForecastTests
| WeatherForecastUITests
WeatherForecast/
|-- Configuration/
|-- DependencyContainer/
|-- ApiService/
|-- Model/
| |-- QueryWeather/
| |-- LocalStorage/
|-- Controllers/
| |-- Base/
| |-- Weather/
| | |-- SearchResults/
| |-- WeatherDetail/
|-- LocalStorage/
| |-- RealmDatabaseService
| |-- RealmMigration
|-- Utils/
WeatherForecastTests
WeatherForecastUITests
```

### Architectural pattern: MVVM

- **Model:** contains the structures of application data.
- **View:** contains the visual components of interfaces. They usually handles the logics of view such as clicked button, a view presentation and so on.
- **ViewModel:** handle all logics relating to bussiness logic.
- **ViewModel:** handle all business logics.

### Design patterns:
1. Decorator: handle scaling text for the disability.
2. Singleton: handle calling APIs, insert/get the weather information from the cache.
1. Dependency Injection (DI): to handle class constructor
2. Singleton: to manage DI's initialization.

### Libraries:
1. SwiftLint: to check automatically the coding convention.

### Cache
The cache is only using a `Dictionary` to store the weather information for simplicity.
2. RealmSwift: to cache favorited cities.

## Installation
1. Download **[the ZIP](https://github.com/hoangthuytruc/WeatherForecast/releases/tag/v1.0)** for the lastest release.
1. Download **[the ZIP](https://github.com/hoangthuytruc/WeatherForecast/releases/tag/v2.0)** for the lastest release.
2. Extract the content of the zip archive in your project directory.
3. Open the terminal, run commands:
```
Expand All @@ -60,14 +58,13 @@ The cache is only using a `Dictionary` to store the weather information for simp
4. Open the file `WeatherForecast.xcworkspace` and **Run**

## Checklist
- [x] Be able to retrieve the weather information from `OpenWeatherMaps API`.
- [x] Allow user to search the information by city's name.
- [x] Handle the search item length must be 3 chracters or above.
- [x] Render the searched results as a list of weather items.
- [x] Support caching mechanism & lifecycle.
- [x] Handle failures.
- [x] Support the disability to scale large text.
- [ ] Support the disability to read out the text using VoiceOver controls.
- [x] Display the weather information for a selected city, fetched from `OpenWeatherMaps API`.
- [x] Allow uses to save their favorite citites using local database.
- [x] Create a main screen with a search bar and a list of saved favorite cities.
- [x] Create a detailed screen to display the weather information foe the selected city.
- [x] Use URLSession for network module.
- [x] Use Codable for parsing JSON.
- [x] Use Realm database and implement CRUD operations.
- [x] UnitTests
- [ ] UITests

Expand Down
Loading

0 comments on commit 06706e2

Please sign in to comment.