Template to generate VIPER classes on Xcode.
VIPER is a backronym for View, Interactor, Presenter, Entity and Router. It’s basically an approach that implements the Single Responsibility Principle to create a cleaner and more modular structure for your iOS project. You can learn more about it in this blog post.
- Download VIPER Template or clone the project
- Copy the
Design Pattern
folder to~/Library/Developer/Xcode/Templates/File Templates/
or create a symbolic link to that folder. - Add files that are under the Project Files folder to your project.
- Start Xcode and create a new group for your VIPER module
- Create a new file (
File > New > File
or⌘N
) - Choose
Design Pattern
andVIPER
- Type in the name of the module you want to create
- Not required: To create Xcode groups, remove the references to the newly created files and add them back to the project
Contract
-> Contains all the protocols used in VIPERInteractor
Presenter
ViewController
(AKA View)Router
ViewController.storyboard