When you decide to use VIPER architecture in your project, it is very tired create new modules, because you need create at least 5 files for each. Imagine that you need to create 6 modules... Based on this template with little improvements.
Only need execute this command in terminal:
sudo swift install.swift
You should be this output message:
If all it's ok you now could find your template in Xcode.
Go to Application folder, browse to the Xcode application icon. Right-click it and choose 'Show Package Contents'. Then browse to:
Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/Project Templates/iOS/Application
and add "Module VIPER.xctemplate" file. Now you can find your template in Xcode.
This template generates all files that you need to create a new VIPER module. All generated code is Swift 3.
This is an example, we're creating a Login module:
After using VIPER, I've found it to be very beneficial in many ways. Let’s get back to the list of things we set out to accomplish when architecting our app to see if VIPER addresses them.
- Easy to iterate on
- Collaboration friendly
- Separated out concerns
- Spec-ability