VIPER Architecture in iOS

Software architecture is the process of defining a structured solution that meets all of the technical and operational requirements. In mobile literature, you heavily heard MVC from Apple’s and Google’s official documentations. If you are a beginner, the way how they structured an mobile software is good, however, if you are a part of big project (which can be discussed what is big?), MVC limits you and enables the violation of important principles like SRP which directly affects the testability of the software. So we really need better architectures.

MVP, MVVM and VIPER are one of these better architectures for big projects. I will not go into detail what they are and when to use them, you can read the articles in the references. In this post, I will mention VIPER in a practical manner

I pushed a gem that you can easily generate a VIPER architecture for your module with vipergen-xctestable

sudo gem install vipergen-xctestable

and next

vipergen generate Auth –path=. –language=swift –author=’hhtopcu’ –template=xctestable –swift-module MyViper

// Some code

References

comments powered by Disqus