Creating a VIPER template with Generamba
If you don’t like spending a lot of time creating templates for VIPER you can use Generamba.
First you need to check the version of Ruby, it must be at least 2.2
ruby --version
Installation:
sudo gem install generamba
//Вводим свой пароль
cd путь к проекту
generamba setup // добавит generambafile для настройки
You will need to answer questions about your project
//После окончания нужно ввести в консоль:
cat Rambafile
And so we got Rambafile in it, we can specify the path to create a template and add templates, etc.
General template directory for the code generator: https://github.com/strongself/generamba-catalog
In Templates we specify the template that we have chosen from the template directory:
- {name: rviper_controller} //VIPER objective c шаблон
//После добавления нужно сохранить шаблон
generamba template install // пишем в консоль
After saving, we can create a template in the project, for this we write in the terminal:
generamba gen [MODULE_NAME] [TEMPLATE_NAME]
[MODULE_NAME] – module name for example: Main, Store, MyProfile ….
[TEMPLATE_NAME] – insert a template from the library
generamba gen Coffe rviper_controller // Objctive-C
generamba gen MusicList swifty_viper // SWIFT
Done, we have generated templates: