Viper Template makes the process of generation of the Viper's modules easier and faster.
VIPER
In looking for a better way to architect an iOS app I ran across the Clean Architecture, as described by Uncle Bob. Clean Architecture divides an app’s logical structure into distinct layers of responsibility. This makes it easier to isolate dependencies (e.g. your database) and to test the interactions at the boundaries between layers.
VIPER is our application of Clean Architecture to iOS apps. The word VIPER is a backronym for View, Interactor, Presenter, Entity and Routing.
-
View — The presentation layer (UI).
-
Interactor — contains business logic related to the data (Entities) or networking, like creating new instances of entities or fetching them from the server. For those purposes you’ll use some Services and Managers which are not considered as a part of VIPER module but rather an external dependency.
-
Presenter — contains the UI related (but UIKit independent) business logic, invokes methods on the Interactor.
-
Entities — your plain data objects, not the data access layer, because that is a responsibility of the Interactor.
-
Router — responsible for the segues and routes between the VIPER modules.
##Viper files
- {{ModuleName}}ViewController.swift
- {{ModuleName}}Interactor.swift
- {{ModuleName}}Presenter.swift
- {{ModuleName}}Model.swift
- {{ModuleName}}Router.swift
- {{ModuleName}}Protocols.swift
Clone the repository https://github.com/gui-assis/ViperTemplate.git and run installation script make install_templates
- [The Clean Architecture] (http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html)
- [Clean Architecture] (http://blog.8thlight.com/uncle-bob/2011/11/22/Clean-Architecture.html)
- [Clean Swift] (http://clean-swift.com/)
- [Medium - iOS Architecture Patterns (Bohdan Orlov)] (https://medium.com/ios-os-x-development/ios-architecture-patterns-ecba4c38de52#.6olof0y3s)
- [VIPER Introduction] (http://mutualmobile.github.io/blog/2013/12/04/viper-introduction/)

