I would like to talk about the alternative to VIPER — Clean Swift. At first glance, Clean Swift is similar to VIPER; however, the differences become visible after looking at the way the modules interact. The interaction between them happens in cycles. Data transmission is based on protocols (again, similar to VIPER), which allows for replacing one of the components of the system with another one. Generally the interaction process looks like this: the user clicks on a button, the View Controller creates an object with a description and sends it to the Interactor. Interactor, in turn, launches a specific scenario following its business logic, then produces a result object and transfers it to Presenter. Presenter generates an object with the data formatted for presenting it to the user and sends it to the View Controller. Clean Swift (as opposed to VIPER) has a unidirectional flow of data processing and decision making . There is always only one cycle — View Controller— Interactor — ...
Tools, Apps, Tips & Tricks