A Swift Example of ISL's MVVM Technique
- Create an account or grab a new API key from Dark Sky API
- Make sure CocoaPods is installed and up to date. Run
pod installin the project directory.
- At the root of the repo find the
keys_template.plstfile. Copy or rename to
swift-mvvm.workspaceand drag the
keys.plistinto the project and add to target. Open the file an put your API Key in the plist under
- Build and run!
To minimize code and highlight the MVVM structure, two dependencies were used to make network calls easier.
📱 Project Overview
NetworkManager.swift- Handles the GET Request to Dark Sky's API.
WeatherData.swift- Data model with the information we want to show in the app.
WeatherViewModel.swift- Takes in
WeatherDataand formats the data to be displayed in the views.
WeatherTableViewCell.swift- Updates the view from the view model.
Utilities.swift- Converts the payload into an array of