Skip to content

fernandocruz/ViperTemplate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ViperTemplate

Viper Template makes the process of generation of the Viper's modules easier and faster.

About Viper

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.

VIPER

  • View — responsible for the presentation layer (GUI), for iOS environment think of everything starting with ‘UI’ prefix.

  • 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 between the VIPER modules.

##Viper files structute

+-- Data
| - {{ModuleName}}Model.swift
+-- Logic
| - {{ModuleName}}Interactor.swift
| - {{ModuleName}}DataManager.swift
+-- Module
| - {{ModuleName}}Module.swift
+-- UI
| +-- Presenter
| | - {{ModuleName}}Presenter.swift
| +-- Routing
| | - {{ModuleName}}Wireframe.swift
| +-- View
| | # Storyboard file
| | +-- Controllers
| | | - {{ModuleName}}ViewController.swift  

How to install

Clone the repository https://github.com/gui-assis/ViperTemplate.git and run installation script make install_templates

How to use

New File -> Viper -> Module alt tag

TODO

  • Generate viper modules templates
  • Create sample application using ViperTemplate
  • Generate viper modules testes templates
  • Generate viper templates using RxSwift

References

About

Viper Template makes the process of generation of the Viper's modules easier and faster.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Makefile 100.0%