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.
WeatherForecast/
|-- Configuration/
|-- DependencyContainer/
|-- ApiService/
|-- Model/
| |-- QueryWeather/
| |-- LocalStorage/
|-- Controllers/
| |-- Base/
| |-- Weather/
| | |-- SearchResults/
| |-- WeatherDetail/
|-- LocalStorage/
| |-- RealmDatabaseService
| |-- RealmMigration
|-- Utils/
WeatherForecastTests
WeatherForecastUITests
- 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 business logics.
- Dependency Injection (DI): to handle class constructor
- Singleton: to manage DI's initialization.
- SwiftLint: to check automatically the coding convention.
- RealmSwift: to cache favorited cities.
- Download the ZIP for the lastest release.
- Extract the content of the zip archive in your project directory.
- Open the terminal, run commands:
cd 'your project directory'
pod install
Note: If CocoaPods have not been installed, run command:
$ sudo gem install cocoapods
- Open the file
WeatherForecast.xcworkspace
and Run
- Display the weather information for a selected city, fetched from
OpenWeatherMaps API
. - Allow uses to save their favorite citites using local database.
- Create a main screen with a search bar and a list of saved favorite cities.
- Create a detailed screen to display the weather information foe the selected city.
- Use URLSession for network module.
- Use Codable for parsing JSON.
- Use Realm database and implement CRUD operations.
- UnitTests
- UITests
The OpenWeatherMaps API
requires APPID
to access its APIs. In case of the default APPID
invalid, you can replace it with yours (sign up and get a new one for free), simply use:
Configuration.appID = 'your APPID'