This is a clean iOS project structured as follow:
- MVVM
- Clean architecture
- Repository pattern
- Navigation router pattern
- Cocoapods for dependency manager
- Full use of Dependency Injection
- Async Await for network request
- Combine for view model and view controller binding
- Localized, just 2 languages for demo porpouse
- Storyboard for interfaces
- Unit Test
You can use this project as a template to start building your new iOS app.
This is a simple demo project that implement MVVM Clean architecture and repository pattern. It's a COVID-19 dashboard with a very simple (and fake) login view. It collect data from remote or local repository. The local repository, just to keep the app simple, stores the data in UserDefaults but, in a real project, if you need to save a large amount of data, it would be better to use a database like Realm, SQL Lite or Core Data. It include also a Unit test as sample to show how to integrate test on this architecture.
COVID-19 data is real and collected by https://covid19api.com/ but the application is not intended to be a medical tool. COVID-19 api are free and here are used just to show how to execute network request and parse them.
All you need to start with this project is
- Xcode
- Cocoapods
If you don't have cocoapods on your mac, or you don't know what cocoapod is, check this out https://cocoapods.org/
1
After cloning project from Github, open terminal and navigate in project folder
cd /your_loca_path/MVVM-Clean
2
next, install all pods with command.
pod install
When all pods are installed, open project folder by digit on terminal
open .
double click on MVVM-Clean.xcworkspace file and Xcode will be opened.
These are the libraries used in project with github url and a very short description.
SDK | URL | DESCRIPTION |
---|---|---|
Swinject | https://github.com/Swinject/Swinject | Dependency injection framework |
Covid-19 data are collected by COVID-19 API
The users Icons is made by Freepik from www.flaticon.com