this clean code architecture is basically is the updated version of VIPER(View Interactor Presenter Entity(Model) Router). This updated version is called VIP (Viewcontroller Interactor Presenter).
Basic work flow of clean code
- ViewController this will inherit the display protocol, this display protocol has some functions to update the view. This view controller is also responsible to initiate its own interactor presenter router data set etc...
- Interactor interacts with presenter using protocol, interactor basically is responsible for api calls
- Presenter interacts with view controller using display protocol. Presenter is responsible to send data to view controller.
- Router routes from one vc to other.
Api calls
- Api call be done using worker file. There is one base worker which will be inherited by other workers as per project need, here in this project we have user, posts or photos worker.
- Base worker constains only data provider protocols
- Data provider protocols contains all services protocol definitions.
- All workers, which inherits base worker contains the api service for api calls
Services
- There is one base service will be inherited by other services like users etc.
- Base service just initiate only network service or other image services
- Network services just a wrapper for almofire services
These all services takes request and returns in response
Services also contains the router, this is basically the HTTP routers which contains the http methods, url for api, and parameters as well...